SHARE
TWEET

Untitled

a guest Mar 21st, 2019 58 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.         (thisArea) => {
  2.           let tempCoords = thisArea.coords;
  3.  
  4.           if (thisArea.coords.length == 4) {
  5.             tempCoords = [ // in case of rectangle (only 2 coords)
  6.               thisArea.coords[0], thisArea.coords[1],
  7.               thisArea.coords[2], thisArea.coords[1],
  8.               thisArea.coords[2], thisArea.coords[3],
  9.               thisArea.coords[0], thisArea.coords[3],
  10.             ];
  11.           }
  12.  
  13.           let coordsString = '';
  14.  
  15.           for (var i = 0; i < tempCoords.length; i = i+2) {
  16.             coordsString += tempCoords[i]+','+tempCoords[i+1]+' ';
  17.           }
  18.  
  19.           let svgColor = '#ffffff';
  20.           let svgOpacity = '0.2';
  21.           if (thisArea.flat.flatStatus == 2) {
  22.             svgColor = '#dfb452';
  23.             svgOpacity = '0.5';
  24.           } else if (thisArea.flat.flatStatus == 3) {
  25.             svgColor = '#ff0000';
  26.             svgOpacity = '0.4';
  27.           }
  28.  
  29.           return (
  30.             <svg height="619" width="1024">
  31.               <polygon points={coordsString} style={{
  32.                 'fill': svgColor,
  33.                 'fill-opacity': svgOpacity,
  34.                 'stroke': '#ffffff',
  35.                 'stroke-width': 0,
  36.                 'height': "100%",
  37.                 'width': "100%",
  38.                 'viewBox': "0 0 100 100",
  39.                 'preserveAspectRatio': "none"
  40.               }} />
  41.             </svg>
  42.           );
  43.         }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top