Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nayla #11

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Binary file added .DS_Store
Binary file not shown.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"ast":null,"code":"var getArea = function getArea(a, b) {\n return a * b;\n};\n\nvar getPointDistance = function getPointDistance(a, b) {\n return Math.sqrt(Math.pow(a[0] - b[0], 2) + Math.pow(a[1] - b[1], 2));\n};\n\nexport var getElementVisibleWidth = function getElementVisibleWidth(elementWidth, xOffset, ScreenWidth) {\n if (xOffset >= 0) {\n return xOffset + elementWidth <= ScreenWidth ? elementWidth : ScreenWidth - xOffset;\n }\n\n return elementWidth - xOffset;\n};\n\nvar getTooltipCoordinate = function getTooltipCoordinate(x, y, width, height, ScreenWidth, ScreenHeight, tooltipWidth, tooltipHeight, withPointer) {\n var center = [x + getElementVisibleWidth(width, x, ScreenWidth) / 2, y + height / 2];\n var pOne = [center[0], 0];\n var pTwo = [ScreenWidth, center[1]];\n var pThree = [center[0], ScreenHeight];\n var pFour = [0, center[1]];\n var vOne = getPointDistance(center, pOne);\n var vTwo = getPointDistance(center, pTwo);\n var vThree = getPointDistance(center, pThree);\n var vFour = getPointDistance(center, pFour);\n var areas = [getArea(vOne, vFour), getArea(vOne, vTwo), getArea(vTwo, vThree), getArea(vThree, vFour)].map(function (each, index) {\n return {\n area: each,\n id: index\n };\n });\n var sortedArea = areas.sort(function (a, b) {\n return b.area - a.area;\n });\n var dX = 0.001;\n var dY = height / 2;\n var directionCorrection = [[-1, -1], [1, -1], [1, 1], [-1, 1]];\n var deslocateReferencePoint = [[-tooltipWidth, -tooltipHeight], [0, -tooltipHeight], [0, 0], [-tooltipWidth, 0]];\n var qIndex = sortedArea[0].id;\n\n var getWithPointerOffsetY = function getWithPointerOffsetY() {\n return withPointer ? 10 * directionCorrection[qIndex][1] : 0;\n };\n\n var getWithPointerOffsetX = function getWithPointerOffsetX() {\n return withPointer ? center[0] - 18 * directionCorrection[qIndex][0] : center[0];\n };\n\n var newX = getWithPointerOffsetX() + (dX * directionCorrection[qIndex][0] + deslocateReferencePoint[qIndex][0]);\n return {\n x: constraintX(newX, qIndex, center[0], ScreenWidth, tooltipWidth),\n y: center[1] + (dY * directionCorrection[qIndex][1] + deslocateReferencePoint[qIndex][1]) + getWithPointerOffsetY()\n };\n};\n\nvar constraintX = function constraintX(newX, qIndex, x, ScreenWidth, tooltipWidth) {\n switch (qIndex) {\n case 0:\n case 3:\n {\n var maxWidth = newX > ScreenWidth ? ScreenWidth - 10 : newX;\n return newX < 1 ? 10 : maxWidth;\n }\n\n case 1:\n case 2:\n {\n var leftOverSpace = ScreenWidth - newX;\n return leftOverSpace >= tooltipWidth ? newX : newX - (tooltipWidth - leftOverSpace + 10);\n }\n\n default:\n {\n return 0;\n }\n }\n};\n\nexport default getTooltipCoordinate;","map":{"version":3,"sources":["E:/Users/Nayla/Escritorio/UADEE/Distribuidas desk/SUBASTAPP/node_modules/react-native-elements/src/tooltip/getTooltipCoordinate.js"],"names":["getArea","a","b","getPointDistance","Math","sqrt","pow","getElementVisibleWidth","elementWidth","xOffset","ScreenWidth","getTooltipCoordinate","x","y","width","height","ScreenHeight","tooltipWidth","tooltipHeight","withPointer","center","pOne","pTwo","pThree","pFour","vOne","vTwo","vThree","vFour","areas","map","each","index","area","id","sortedArea","sort","dX","dY","directionCorrection","deslocateReferencePoint","qIndex","getWithPointerOffsetY","getWithPointerOffsetX","newX","constraintX","maxWidth","leftOverSpace"],"mappings":"AAAA,IAAMA,OAAO,GAAG,SAAVA,OAAU,CAACC,CAAD,EAAIC,CAAJ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,MAAR;AAEE,SAAK,CAAL;AACA,SAAK,CAAL;AAAQ;AACN,YAAMK,QAAQ,GAAGF,IAAI,GAAGlC,WAAP,GAAqBA,WAAW,GAAG,EAAnC,GAAwCkC,IAAzD;AACA,eAAOA,IAAI,GAAG,CAAP,GAAW,EAAX,GAAgBE,QAAvB;AACD;;AAED,SAAK,CAAL;AACA,SAAK,CAAL;AAAQ;AACN,YAAMC,aAAa,GAAGrC,WAAW,GAAGkC,IAApC;AACA,eAAOG,aAAa,IAAI9B,YAAjB,GACH2B,IADG,GAEHA,IAAI,IAAI3B,YAAY,GAAG8B,aAAf,GAA+B,EAAnC,CAFR;AAGD;;AACD;AAAS;AACP,eAAO,CAAP;AACD;AAjBH;AAmBD,CApBD;;AAsBA,eAAepC,oBAAf","sourcesContent":["const getArea = (a, b) => a * b;\n\nconst getPointDistance = (a, b) =>\n Math.sqrt(Math.pow(a[0] - b[0], 2) + Math.pow(a[1] - b[1], 2));\n\nexport const getElementVisibleWidth = (elementWidth, xOffset, ScreenWidth) => {\n // Element is fully visible OR scrolled right\n if (xOffset >= 0) {\n return xOffset + elementWidth <= ScreenWidth // is element fully visible?\n ? elementWidth // element is fully visible;\n : ScreenWidth - xOffset; // calculate visible width of scrolled element\n }\n // Element is scrolled LEFT\n\n return elementWidth - xOffset; // calculate visible width of scrolled element\n};\n\n/*\ntype Coord = {\n x: number,\n y: number,\n};\n\n ~Tooltip coordinate system:~\n The tooltip coordinates are based on the element which it is wrapping.\n We take the x and y coordinates of the element and find the best position\n to place the tooltip. To find the best position we look for the side with the\n most space. In order to find the side with the most space we divide the the\n surroundings in four quadrants and check for the one with biggest area.\n Once we know the quandrant with the biggest area it place the tooltip in that\n direction.\n\n To find the areas we first get 5 coordinate points. The center and the other 4 extreme points\n which together make a perfect cross shape.\n\n Once we know the coordincates we can get the length of the vertices which form each quadrant.\n Since they are squares we only need two.\n*/\n\nconst getTooltipCoordinate = (\n x,\n y,\n width,\n height,\n ScreenWidth,\n ScreenHeight,\n tooltipWidth,\n tooltipHeight,\n withPointer\n) => {\n // The following are point coordinates: [x, y]\n const center = [\n x + getElementVisibleWidth(width, x, ScreenWidth) / 2,\n y + height / 2,\n ];\n const pOne = [center[0], 0];\n const pTwo = [ScreenWidth, center[1]];\n const pThree = [center[0], ScreenHeight];\n const pFour = [0, center[1]];\n\n // vertices\n const vOne = getPointDistance(center, pOne);\n const vTwo = getPointDistance(center, pTwo);\n const vThree = getPointDistance(center, pThree);\n const vFour = getPointDistance(center, pFour);\n\n // Quadrant areas.\n // type Areas = {\n // area: number,\n // id: number,\n // };\n\n const areas = [\n getArea(vOne, vFour),\n getArea(vOne, vTwo),\n getArea(vTwo, vThree),\n getArea(vThree, vFour),\n ].map((each, index) => ({ area: each, id: index }));\n\n const sortedArea = areas.sort((a, b) => b.area - a.area);\n\n // deslocated points\n const dX = 0.001;\n const dY = height / 2;\n\n // Deslocate the coordinates in the direction of the quadrant.\n const directionCorrection = [[-1, -1], [1, -1], [1, 1], [-1, 1]];\n const deslocateReferencePoint = [\n [-tooltipWidth, -tooltipHeight],\n [0, -tooltipHeight],\n [0, 0],\n [-tooltipWidth, 0],\n ];\n\n // current quadrant index\n const qIndex = sortedArea[0].id;\n\n const getWithPointerOffsetY = () =>\n withPointer ? 10 * directionCorrection[qIndex][1] : 0;\n const getWithPointerOffsetX = () =>\n withPointer ? center[0] - 18 * directionCorrection[qIndex][0] : center[0];\n\n const newX =\n getWithPointerOffsetX() +\n (dX * directionCorrection[qIndex][0] + deslocateReferencePoint[qIndex][0]);\n\n return {\n x: constraintX(newX, qIndex, center[0], ScreenWidth, tooltipWidth),\n y:\n center[1] +\n (dY * directionCorrection[qIndex][1] +\n deslocateReferencePoint[qIndex][1]) +\n getWithPointerOffsetY(),\n };\n};\n\nconst constraintX = (newX, qIndex, x, ScreenWidth, tooltipWidth) => {\n switch (qIndex) {\n // 0 and 3 are the left side quadrants.\n case 0:\n case 3: {\n const maxWidth = newX > ScreenWidth ? ScreenWidth - 10 : newX;\n return newX < 1 ? 10 : maxWidth;\n }\n // 1 and 2 are the right side quadrants\n case 1:\n case 2: {\n const leftOverSpace = ScreenWidth - newX;\n return leftOverSpace >= tooltipWidth\n ? newX\n : newX - (tooltipWidth - leftOverSpace + 10);\n }\n default: {\n return 0;\n }\n }\n};\n\nexport default getTooltipCoordinate;\n"]},"metadata":{},"sourceType":"module"}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"ast":null,"code":"export default {};","map":{"version":3,"sources":["E:/Users/Nayla/Escritorio/UADEE/Distribuidas desk/SUBASTAPP/node_modules/react-native-web/dist/exports/PermissionsAndroid/index.js"],"names":[],"mappings":"AAAA,eAAe,EAAf","sourcesContent":["export default {};"]},"metadata":{},"sourceType":"module"}
Loading