@emerson-eps/color-tables 0.4.100 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (114) hide show
  1. package/dist/component/BreakPoint/Canvas.d.ts +3 -3
  2. package/dist/component/BreakPoint/Canvas.js +10 -21
  3. package/dist/component/BreakPoint/Canvas.js.map +1 -1
  4. package/dist/component/BreakPoint/ColorScale.d.ts +2 -3
  5. package/dist/component/BreakPoint/ColorScale.js +19 -20
  6. package/dist/component/BreakPoint/ColorScale.js.map +1 -1
  7. package/dist/component/BreakPoint/Legend.d.ts +2 -3
  8. package/dist/component/BreakPoint/Legend.js +31 -37
  9. package/dist/component/BreakPoint/Legend.js.map +1 -1
  10. package/dist/component/BreakPoint/Modal.d.ts +6 -3
  11. package/dist/component/BreakPoint/Modal.js +17 -21
  12. package/dist/component/BreakPoint/Modal.js.map +1 -1
  13. package/dist/component/BreakPoint/index.d.ts +4 -0
  14. package/dist/component/BreakPoint/index.js +6 -0
  15. package/dist/component/BreakPoint/index.js.map +1 -0
  16. package/dist/component/ColorSelector/BreakPointModule.d.ts +3 -4
  17. package/dist/component/ColorSelector/BreakPointModule.js +99 -140
  18. package/dist/component/ColorSelector/BreakPointModule.js.map +1 -1
  19. package/dist/component/ColorSelector/ColorSelectorAccordion.js +55 -60
  20. package/dist/component/ColorSelector/ColorSelectorAccordion.js.map +1 -1
  21. package/dist/component/ColorSelector/ColorSelectorComponent.d.ts +2 -3
  22. package/dist/component/ColorSelector/ColorSelectorComponent.js +83 -86
  23. package/dist/component/ColorSelector/ColorSelectorComponent.js.map +1 -1
  24. package/dist/component/ColorSelector/ColorSelectorWrapper.d.ts +12 -5
  25. package/dist/component/ColorSelector/ColorSelectorWrapper.js +41 -51
  26. package/dist/component/ColorSelector/ColorSelectorWrapper.js.map +1 -1
  27. package/dist/component/ColorSelector/index.d.ts +4 -0
  28. package/dist/component/ColorSelector/index.js +6 -0
  29. package/dist/component/ColorSelector/index.js.map +1 -0
  30. package/dist/component/Legend/ColorLegend.d.ts +2 -2
  31. package/dist/component/Legend/ColorLegend.js +38 -39
  32. package/dist/component/Legend/ColorLegend.js.map +1 -1
  33. package/dist/component/Legend/ColorLegend.stories.js +20 -31
  34. package/dist/component/Legend/ColorLegend.stories.js.map +1 -1
  35. package/dist/component/Legend/ContinuousLegend.d.ts +2 -2
  36. package/dist/component/Legend/ContinuousLegend.js +230 -276
  37. package/dist/component/Legend/ContinuousLegend.js.map +1 -1
  38. package/dist/component/Legend/ContinuousLegend.stories.js +13 -24
  39. package/dist/component/Legend/ContinuousLegend.stories.js.map +1 -1
  40. package/dist/component/Legend/DiscreteLegend.d.ts +2 -2
  41. package/dist/component/Legend/DiscreteLegend.js +130 -180
  42. package/dist/component/Legend/DiscreteLegend.js.map +1 -1
  43. package/dist/component/Legend/DiscreteLegend.stories.js +15 -26
  44. package/dist/component/Legend/DiscreteLegend.stories.js.map +1 -1
  45. package/dist/component/Legend/constants.js +1 -1
  46. package/dist/component/Legend/constants.js.map +1 -1
  47. package/dist/component/Legend/index.d.ts +3 -0
  48. package/dist/component/Legend/index.js +4 -0
  49. package/dist/component/Legend/index.js.map +1 -0
  50. package/dist/component/Utils/d3ColorScale.js +1 -1
  51. package/dist/component/Utils/d3ColorScale.js.map +1 -1
  52. package/dist/component/Utils/discreteLegend.d.ts +2 -3
  53. package/dist/component/Utils/discreteLegend.js.map +1 -1
  54. package/dist/component/Utils/index.d.ts +2 -0
  55. package/dist/component/Utils/index.js +4 -0
  56. package/dist/component/Utils/index.js.map +1 -0
  57. package/dist/component/Utils/legendCommonFunction.d.ts +7 -7
  58. package/dist/component/Utils/legendCommonFunction.js +128 -139
  59. package/dist/component/Utils/legendCommonFunction.js.map +1 -1
  60. package/dist/component/Utils/legendCommonFunction.stories.js +14 -25
  61. package/dist/component/Utils/legendCommonFunction.stories.js.map +1 -1
  62. package/dist/component/colorTableTypes.d.ts +10 -2
  63. package/dist/component/index.d.ts +6 -0
  64. package/dist/component/index.js +7 -0
  65. package/dist/component/index.js.map +1 -0
  66. package/dist/index.d.ts +1 -9
  67. package/dist/index.js +1 -8
  68. package/dist/index.js.map +1 -1
  69. package/dist/stories/ColorLegends/ContinousLegends/MD.stories.d.ts +7 -0
  70. package/dist/stories/ColorLegends/ContinousLegends/MD.stories.js +34 -0
  71. package/dist/stories/ColorLegends/ContinousLegends/MD.stories.js.map +1 -0
  72. package/dist/stories/ColorLegends/ContinousLegends/NTG.stories.d.ts +7 -0
  73. package/dist/stories/ColorLegends/ContinousLegends/NTG.stories.js +34 -0
  74. package/dist/stories/ColorLegends/ContinousLegends/NTG.stories.js.map +1 -0
  75. package/dist/stories/ColorLegends/ContinousLegends/PermTot.stories.d.ts +7 -0
  76. package/dist/stories/ColorLegends/ContinousLegends/PermTot.stories.js +34 -0
  77. package/dist/stories/ColorLegends/ContinousLegends/PermTot.stories.js.map +1 -0
  78. package/dist/stories/ColorLegends/ContinousLegends/Permeability.stories.d.ts +7 -0
  79. package/dist/stories/ColorLegends/ContinousLegends/Permeability.stories.js +36 -0
  80. package/dist/stories/ColorLegends/ContinousLegends/Permeability.stories.js.map +1 -0
  81. package/dist/stories/ColorLegends/ContinousLegends/PoroTot.stories.d.ts +7 -0
  82. package/dist/stories/ColorLegends/ContinousLegends/PoroTot.stories.js +34 -0
  83. package/dist/stories/ColorLegends/ContinousLegends/PoroTot.stories.js.map +1 -0
  84. package/dist/stories/ColorLegends/ContinousLegends/Porosity.stories.d.ts +7 -0
  85. package/dist/stories/ColorLegends/ContinousLegends/Porosity.stories.js +34 -0
  86. package/dist/stories/ColorLegends/ContinousLegends/Porosity.stories.js.map +1 -0
  87. package/dist/stories/ColorLegends/ContinousLegends/SW.stories.d.ts +7 -0
  88. package/dist/stories/ColorLegends/ContinousLegends/SW.stories.js +34 -0
  89. package/dist/stories/ColorLegends/ContinousLegends/SW.stories.js.map +1 -0
  90. package/dist/stories/ColorLegends/DiscreteLegends/FaciesNoCalcite.stories.d.ts +7 -0
  91. package/dist/stories/ColorLegends/DiscreteLegends/FaciesNoCalcite.stories.js +39 -0
  92. package/dist/stories/ColorLegends/DiscreteLegends/FaciesNoCalcite.stories.js.map +1 -0
  93. package/dist/stories/ColorLegends/DiscreteLegends/FaultDistanceHum.stories.d.ts +7 -0
  94. package/dist/stories/ColorLegends/DiscreteLegends/FaultDistanceHum.stories.js +31 -0
  95. package/dist/stories/ColorLegends/DiscreteLegends/FaultDistanceHum.stories.js.map +1 -0
  96. package/dist/stories/ColorLegends/DiscreteLegends/FaultProximityFlag.stories.d.ts +7 -0
  97. package/dist/stories/ColorLegends/DiscreteLegends/FaultProximityFlag.stories.js +31 -0
  98. package/dist/stories/ColorLegends/DiscreteLegends/FaultProximityFlag.stories.js.map +1 -0
  99. package/dist/stories/ColorLegends/DiscreteLegends/RDE.stories.d.ts +7 -0
  100. package/dist/stories/ColorLegends/DiscreteLegends/RDE.stories.js +34 -0
  101. package/dist/stories/ColorLegends/DiscreteLegends/RDE.stories.js.map +1 -0
  102. package/dist/stories/ColorLegends/DiscreteLegends/RDE_Orig.stories.d.ts +7 -0
  103. package/dist/stories/ColorLegends/DiscreteLegends/RDE_Orig.stories.js +45 -0
  104. package/dist/stories/ColorLegends/DiscreteLegends/RDE_Orig.stories.js.map +1 -0
  105. package/dist/stories/ColorLegends/DiscreteLegends/ZoneMain.stories.d.ts +7 -0
  106. package/dist/stories/ColorLegends/DiscreteLegends/ZoneMain.stories.js +34 -0
  107. package/dist/stories/ColorLegends/DiscreteLegends/ZoneMain.stories.js.map +1 -0
  108. package/dist/stories/ColorLegends/DiscreteLegends/Zonelog.stories.d.ts +7 -0
  109. package/dist/stories/ColorLegends/DiscreteLegends/Zonelog.stories.js +44 -0
  110. package/dist/stories/ColorLegends/DiscreteLegends/Zonelog.stories.js.map +1 -0
  111. package/dist/stories/ColorLegends/LegendWithSelector/LegendSelector.stories.d.ts +7 -0
  112. package/dist/stories/ColorLegends/LegendWithSelector/LegendSelector.stories.js +33 -0
  113. package/dist/stories/ColorLegends/LegendWithSelector/LegendSelector.stories.js.map +1 -0
  114. package/package.json +8 -7
@@ -1,25 +1,14 @@
1
- var __assign = (this && this.__assign) || function () {
2
- __assign = Object.assign || function(t) {
3
- for (var s, i = 1, n = arguments.length; i < n; i++) {
4
- s = arguments[i];
5
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
- t[p] = s[p];
7
- }
8
- return t;
9
- };
10
- return __assign.apply(this, arguments);
11
- };
12
1
  import React from "react";
13
2
  import { ContinuousLegend, } from "../../component/Legend/ContinuousLegend";
14
3
  export default {
15
4
  component: ContinuousLegend,
16
5
  title: "Legends / ContinuousLegend",
17
6
  };
18
- var min = 0;
19
- var max = 1;
20
- var dataObjectName = "Physics color map";
21
- var colorName = "Physics";
22
- var DEFAULT_ARGS = {
7
+ const min = 0;
8
+ const max = 1;
9
+ const dataObjectName = "Physics color map";
10
+ const colorName = "Physics";
11
+ const DEFAULT_ARGS = {
23
12
  min: min,
24
13
  max: max,
25
14
  isRangeShown: true,
@@ -28,15 +17,15 @@ var DEFAULT_ARGS = {
28
17
  numberOfTicks: 3,
29
18
  legendScaleSize: 300,
30
19
  };
31
- var Story = function (args) {
32
- return React.createElement(ContinuousLegend, __assign({}, args));
20
+ const Story = (args) => {
21
+ return React.createElement(ContinuousLegend, Object.assign({}, args));
33
22
  };
34
- export var StandardColorTableLibrary = Story.bind({});
35
- StandardColorTableLibrary.args = __assign(__assign({}, DEFAULT_ARGS), { dataObjectName: dataObjectName, colorName: colorName });
36
- export var DefaultColorTable = Story.bind({});
37
- DefaultColorTable.args = __assign(__assign({}, DEFAULT_ARGS), { dataObjectName: "Default color table (Rainbow)" });
38
- export var BackgroundColor = function () {
39
- return (React.createElement(ContinuousLegend, __assign({}, DEFAULT_ARGS, { dataObjectName: dataObjectName, cssLegendStyles: {
23
+ export const StandardColorTableLibrary = Story.bind({});
24
+ StandardColorTableLibrary.args = Object.assign(Object.assign({}, DEFAULT_ARGS), { dataObjectName: dataObjectName, colorName: colorName });
25
+ export const DefaultColorTable = Story.bind({});
26
+ DefaultColorTable.args = Object.assign(Object.assign({}, DEFAULT_ARGS), { dataObjectName: "Default color table (Rainbow)" });
27
+ export const BackgroundColor = () => {
28
+ return (React.createElement(ContinuousLegend, Object.assign({}, DEFAULT_ARGS, { dataObjectName: dataObjectName, cssLegendStyles: {
40
29
  backgroundColor: "red",
41
30
  } })));
42
31
  };
@@ -1 +1 @@
1
- {"version":3,"file":"ContinuousLegend.stories.js","sourceRoot":"","sources":["../../../src/component/Legend/ContinuousLegend.stories.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EACL,gBAAgB,GAEjB,MAAM,yCAAyC,CAAC;AAEjD,eAAe;IACb,SAAS,EAAE,gBAAgB;IAC3B,KAAK,EAAE,6BAA6B;CACrC,CAAC;AAEF,IAAM,GAAG,GAAG,CAAC,CAAC;AACd,IAAM,GAAG,GAAG,CAAC,CAAC;AACd,IAAM,cAAc,GAAG,mBAAmB,CAAC;AAC3C,IAAM,SAAS,GAAG,SAAS,CAAC;AAE5B,IAAM,YAAY,GAA0B;IAC1C,GAAG,EAAE,GAAG;IACR,GAAG,EAAE,GAAG;IACR,YAAY,EAAE,IAAI;IAClB,cAAc,EAAE,EAAE;IAClB,YAAY,EAAE,EAAE;IAChB,aAAa,EAAE,CAAC;IAChB,eAAe,EAAE,GAAG;CACrB,CAAC;AAEF,IAAM,KAAK,GAAG,UAAC,IAA2B;IACxC,OAAO,oBAAC,gBAAgB,eAAK,IAAI,EAAI,CAAC;AACxC,CAAC,CAAC;AAEF,MAAM,CAAC,IAAM,yBAAyB,GAAG,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACxD,yBAAyB,CAAC,IAAI,yBACzB,YAAY,KACf,cAAc,EAAE,cAAc,EAC9B,SAAS,EAAE,SAAS,GACrB,CAAC;AAEF,MAAM,CAAC,IAAM,iBAAiB,GAAG,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAChD,iBAAiB,CAAC,IAAI,yBACjB,YAAY,KACf,cAAc,EAAE,+BAA+B,GAChD,CAAC;AAEF,MAAM,CAAC,IAAM,eAAe,GAAG;IAC7B,OAAO,CACL,oBAAC,gBAAgB,eACX,YAAY,IAChB,cAAc,EAAE,cAAc,EAC9B,eAAe,EAAE;YACf,eAAe,EAAE,KAAK;SACvB,IACD,CACH,CAAC;AACJ,CAAC,CAAC"}
1
+ {"version":3,"file":"ContinuousLegend.stories.js","sourceRoot":"","sources":["../../../src/component/Legend/ContinuousLegend.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EACL,gBAAgB,GAEjB,MAAM,yCAAyC,CAAC;AAEjD,eAAe;IACb,SAAS,EAAE,gBAAgB;IAC3B,KAAK,EAAE,6BAA6B;CACrC,CAAC;AAEF,MAAM,GAAG,GAAG,CAAC,CAAC;AACd,MAAM,GAAG,GAAG,CAAC,CAAC;AACd,MAAM,cAAc,GAAG,mBAAmB,CAAC;AAC3C,MAAM,SAAS,GAAG,SAAS,CAAC;AAE5B,MAAM,YAAY,GAA0B;IAC1C,GAAG,EAAE,GAAG;IACR,GAAG,EAAE,GAAG;IACR,YAAY,EAAE,IAAI;IAClB,cAAc,EAAE,EAAE;IAClB,YAAY,EAAE,EAAE;IAChB,aAAa,EAAE,CAAC;IAChB,eAAe,EAAE,GAAG;CACrB,CAAC;AAEF,MAAM,KAAK,GAAG,CAAC,IAA2B,EAAE,EAAE;IAC5C,OAAO,oBAAC,gBAAgB,oBAAK,IAAI,EAAI,CAAC;AACxC,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,yBAAyB,GAAG,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACxD,yBAAyB,CAAC,IAAI,mCACzB,YAAY,KACf,cAAc,EAAE,cAAc,EAC9B,SAAS,EAAE,SAAS,GACrB,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAG,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAChD,iBAAiB,CAAC,IAAI,mCACjB,YAAY,KACf,cAAc,EAAE,+BAA+B,GAChD,CAAC;AAEF,MAAM,CAAC,MAAM,eAAe,GAAG,GAAG,EAAE;IAClC,OAAO,CACL,oBAAC,gBAAgB,oBACX,YAAY,IAChB,cAAc,EAAE,cAAc,EAC9B,eAAe,EAAE;YACf,eAAe,EAAE,KAAK;SACvB,IACD,CACH,CAAC;AACJ,CAAC,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import * as React from "react";
2
- import { colorTablesArray } from "../colorTableTypes";
2
+ import { ColorTableArray } from "../colorTableTypes";
3
3
  export type DiscreteCodes = Record<string, [number[], number]>;
4
4
  export type DiscreteColorLegendProps = {
5
5
  /**
@@ -35,7 +35,7 @@ export type DiscreteColorLegendProps = {
35
35
  *
36
36
  * Reference: https://github.com/emerson-eps/color-tables/blob/main/react-app/src/component/color-tables.json
37
37
  */
38
- colorTables?: colorTablesArray | string;
38
+ colorTables?: ColorTableArray | string;
39
39
  /**
40
40
  * Font size of legend name (in px)
41
41
  */
@@ -1,14 +1,3 @@
1
- var __assign = (this && this.__assign) || function () {
2
- __assign = Object.assign || function(t) {
3
- for (var s, i = 1, n = arguments.length; i < n; i++) {
4
- s = arguments[i];
5
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
- t[p] = s[p];
7
- }
8
- return t;
9
- };
10
- return __assign.apply(this, arguments);
11
- };
12
1
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
13
2
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
14
3
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -18,33 +7,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
18
7
  step((generator = generator.apply(thisArg, _arguments || [])).next());
19
8
  });
20
9
  };
21
- var __generator = (this && this.__generator) || function (thisArg, body) {
22
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
23
- return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
24
- function verb(n) { return function (v) { return step([n, v]); }; }
25
- function step(op) {
26
- if (f) throw new TypeError("Generator is already executing.");
27
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
28
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
29
- if (y = 0, t) op = [op[0] & 2, t.value];
30
- switch (op[0]) {
31
- case 0: case 1: t = op; break;
32
- case 4: _.label++; return { value: op[1], done: false };
33
- case 5: _.label++; y = op[1]; op = [0]; continue;
34
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
35
- default:
36
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
37
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
38
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
39
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
40
- if (t[2]) _.ops.pop();
41
- _.trys.pop(); continue;
42
- }
43
- op = body.call(thisArg, _);
44
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
45
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
46
- }
47
- };
48
10
  import * as React from "react";
49
11
  import { useRef } from "react";
50
12
  import { select } from "d3";
@@ -53,12 +15,11 @@ import { colorsArray, RGBToHex } from "../Utils/legendCommonFunction";
53
15
  import { d3ColorScales } from "../Utils/d3ColorScale";
54
16
  import defaultColorTables from "../color-tables.json";
55
17
  import { DEFAULT_STYLE } from "./constants";
56
- export var DiscreteColorLegend = function (_a) {
57
- var discreteData = _a.discreteData, dataObjectName = _a.dataObjectName, _b = _a.colorName, colorName = _b === void 0 ? "Stratigraphy" : _b, horizontal = _a.horizontal, getColorScaleData = _a.getColorScaleData, id = _a.id, _c = _a.colorTables, colorTables = _c === void 0 ? defaultColorTables : _c, legendFontSize = _a.legendFontSize, tickFontSize = _a.tickFontSize, numberOfTicks = _a.numberOfTicks, _d = _a.legendScaleSize, legendScaleSize = _d === void 0 ? 200 : _d, _e = _a.cssLegendStyles, cssLegendStyles = _e === void 0 ? DEFAULT_STYLE : _e;
58
- var generateUniqueId = Math.ceil(Math.random() * 9999).toString();
59
- var divRef = useRef(null);
60
- var legendWidth;
61
- var legendHeight;
18
+ export const DiscreteColorLegend = ({ discreteData, dataObjectName, colorName = "Stratigraphy", horizontal, getColorScaleData, id, colorTables = defaultColorTables, legendFontSize, tickFontSize, numberOfTicks, legendScaleSize = 200, cssLegendStyles = DEFAULT_STYLE, }) => {
19
+ const generateUniqueId = Math.ceil(Math.random() * 9999).toString();
20
+ const divRef = useRef(null);
21
+ let legendWidth;
22
+ let legendHeight;
62
23
  if (horizontal) {
63
24
  legendHeight = "30px";
64
25
  if (legendScaleSize < 200) {
@@ -77,151 +38,140 @@ export var DiscreteColorLegend = function (_a) {
77
38
  legendHeight = legendScaleSize - 10;
78
39
  }
79
40
  }
80
- React.useEffect(function () {
41
+ React.useEffect(() => {
81
42
  if (divRef.current) {
82
43
  select(divRef.current).select("div").remove();
83
44
  select(divRef.current).select("svg").remove();
84
45
  discreteLegend();
85
46
  }
86
47
  function discreteLegend() {
87
- return __awaiter(this, void 0, void 0, function () {
88
- var dataSet, useSelectorLegend, itemName, itemColor, res, arrayOfColors_1, d3ColorArrays_1, defaultDiscreteData, entries, sorted, colorLegend, totalRect, currentDiv, svgLegend, error_1;
89
- return __generator(this, function (_a) {
90
- switch (_a.label) {
91
- case 0:
92
- useSelectorLegend = false;
93
- itemName = [];
94
- itemColor = [];
95
- _a.label = 1;
96
- case 1:
97
- _a.trys.push([1, 5, , 6]);
98
- if (!(typeof colorTables === "string")) return [3 /*break*/, 4];
99
- return [4 /*yield*/, fetch(colorTables)];
100
- case 2:
101
- res = _a.sent();
102
- return [4 /*yield*/, res.json()];
103
- case 3:
104
- dataSet = _a.sent();
105
- _a.label = 4;
106
- case 4:
107
- arrayOfColors_1 = typeof colorTables === "string"
108
- ? colorsArray(colorName, dataSet)
109
- : colorsArray(colorName, colorTables);
110
- d3ColorArrays_1 = colorsArray(colorName, d3ColorScales);
111
- defaultDiscreteData = {
112
- discrete_1: [[], 0],
113
- discrete_2: [[], 1],
114
- discrete_3: [[], 2],
115
- discrete_4: [[], 3],
116
- discrete_5: [[], 4],
117
- discrete_6: [[], 5],
118
- discrete_7: [[], 6],
119
- discrete_8: [[], 7],
120
- discrete_9: [[], 8],
121
- discrete_10: [[], 9],
122
- };
123
- // Main single discrete legend
124
- if (!getColorScaleData || getColorScaleData.length === 0) {
125
- entries = Object.entries(discreteData ? discreteData : defaultDiscreteData);
126
- sorted = entries.sort(function (a, b) { return a[1][1] - b[1][1]; });
127
- sorted.forEach(function (value) {
128
- var key = value[0];
129
- var val = value[1];
130
- var code = val[1];
131
- // for colortable colors
132
- if (arrayOfColors_1.length > 0) {
133
- //compare the first value in colorarray(colortable) and code from discreteData
134
- var matchedColorsArrays = arrayOfColors_1.find(function (value) {
135
- return value[0] === code;
136
- });
137
- if (matchedColorsArrays)
138
- itemColor.push({
139
- color: RGBToHex(matchedColorsArrays).color,
140
- name: key,
141
- });
142
- itemName.push(key);
143
- }
144
- // for d3 colors
145
- else {
146
- var matchedColorsArrays = d3ColorArrays_1.find(function (_value, index) {
147
- return index === code;
148
- });
149
- if (matchedColorsArrays)
150
- itemColor.push({ color: matchedColorsArrays });
151
- }
152
- });
153
- }
154
- // Discrete legend using Colortable colors (color selector component)
155
- if (getColorScaleData === null || getColorScaleData === void 0 ? void 0 : getColorScaleData.color) {
156
- getColorScaleData.color.forEach(function (key) {
157
- itemColor.push({ color: RGBToHex(key).color });
158
- });
159
- useSelectorLegend = true;
160
- }
161
- // Discrete legend using d3 colors
162
- if (getColorScaleData === null || getColorScaleData === void 0 ? void 0 : getColorScaleData.colorsObject) {
163
- getColorScaleData.colorsObject.forEach(function (key) {
164
- itemColor.push({ color: key });
48
+ return __awaiter(this, void 0, void 0, function* () {
49
+ let dataSet;
50
+ let useSelectorLegend = false;
51
+ let itemName = [];
52
+ const itemColor = [];
53
+ try {
54
+ // fix for dash wrapper
55
+ if (typeof colorTables === "string") {
56
+ const res = yield fetch(colorTables);
57
+ dataSet = yield res.json();
58
+ }
59
+ const arrayOfColors = typeof colorTables === "string"
60
+ ? colorsArray(colorName, dataSet)
61
+ : colorsArray(colorName, colorTables);
62
+ const d3ColorArrays = colorsArray(colorName, d3ColorScales);
63
+ // temporary fix, will be removed later
64
+ const defaultDiscreteData = {
65
+ discrete_1: [[], 0],
66
+ discrete_2: [[], 1],
67
+ discrete_3: [[], 2],
68
+ discrete_4: [[], 3],
69
+ discrete_5: [[], 4],
70
+ discrete_6: [[], 5],
71
+ discrete_7: [[], 6],
72
+ discrete_8: [[], 7],
73
+ discrete_9: [[], 8],
74
+ discrete_10: [[], 9],
75
+ };
76
+ // Main single discrete legend
77
+ if (!getColorScaleData || getColorScaleData.length === 0) {
78
+ const entries = Object.entries(discreteData ? discreteData : defaultDiscreteData);
79
+ const sorted = entries.sort((a, b) => a[1][1] - b[1][1]);
80
+ sorted.forEach((value) => {
81
+ const key = value[0];
82
+ const val = value[1];
83
+ const code = val[1];
84
+ // for colortable colors
85
+ if (arrayOfColors.length > 0) {
86
+ //compare the first value in colorarray(colortable) and code from discreteData
87
+ const matchedColorsArrays = arrayOfColors.find((value) => {
88
+ return value[0] === code;
165
89
  });
166
- itemName = getColorScaleData.legendColorName;
167
- useSelectorLegend = true;
168
- }
169
- colorLegend = discreteLegendUtil(itemColor, useSelectorLegend, horizontal);
170
- totalRect = void 0;
171
- // Style for main horizontal legend
172
- if (!useSelectorLegend) {
173
- totalRect = itemColor.length;
90
+ if (matchedColorsArrays)
91
+ itemColor.push({
92
+ color: RGBToHex(matchedColorsArrays).color,
93
+ name: key,
94
+ });
95
+ itemName.push(key);
174
96
  }
175
- // Style for color selector legend
97
+ // for d3 colors
176
98
  else {
177
- // calculate width for legend using colortable colors
178
- if (getColorScaleData === null || getColorScaleData === void 0 ? void 0 : getColorScaleData.color) {
179
- totalRect = getColorScaleData.color.length;
180
- }
181
- // calculate width for legend using d3 colors
182
- else {
183
- totalRect = getColorScaleData.colorsObject.length;
184
- }
99
+ const matchedColorsArrays = d3ColorArrays.find((_value, index) => {
100
+ return index === code;
101
+ });
102
+ if (matchedColorsArrays)
103
+ itemColor.push({ color: matchedColorsArrays });
185
104
  }
186
- currentDiv = select(divRef.current);
187
- // append the title
188
- currentDiv
189
- .append("div")
190
- .text(dataObjectName)
191
- .style("color", "grey")
192
- .style("white-space", "nowrap")
193
- .style("overflow", "hidden")
194
- .style("width", "150px")
195
- .style("text-overflow", "ellipsis")
196
- .style("margin-bottom", horizontal ? "5px" : "0px")
197
- .style("font-size", legendFontSize && legendFontSize > 0
198
- ? "".concat(legendFontSize, "px")
199
- : "16px")
200
- .style("transform", horizontal ? "none" : "translate(-69px, 80px) rotate(270deg)");
201
- svgLegend = currentDiv
202
- .style("margin", horizontal ? "5px 0px 0px 15px" : "0px 5px 0px 5px")
203
- .style("width", legendWidth)
204
- .append("svg")
205
- .call(colorLegend);
206
- svgLegend
207
- .attr("viewBox", horizontal ? "0 0 ".concat(totalRect, " 1.5") : "0 0 2 ".concat(totalRect))
208
- .attr("preserveAspectRatio", "none")
209
- .style("font-size", ".4")
210
- .style("margin-left", horizontal ? "0" : "20px")
211
- .attr("height", legendHeight)
212
- .attr("width", horizontal
213
- ? legendScaleSize < 200
214
- ? 190
215
- : legendScaleSize - 10
216
- : "40px");
217
- return [3 /*break*/, 6];
218
- case 5:
219
- error_1 = _a.sent();
220
- console.error(error_1);
221
- return [3 /*break*/, 6];
222
- case 6: return [2 /*return*/];
105
+ });
106
+ }
107
+ // Discrete legend using Colortable colors (color selector component)
108
+ if (getColorScaleData === null || getColorScaleData === void 0 ? void 0 : getColorScaleData.color) {
109
+ getColorScaleData.color.forEach((key) => {
110
+ itemColor.push({ color: RGBToHex(key).color });
111
+ });
112
+ useSelectorLegend = true;
113
+ }
114
+ // Discrete legend using d3 colors
115
+ if (getColorScaleData === null || getColorScaleData === void 0 ? void 0 : getColorScaleData.colorsObject) {
116
+ getColorScaleData.colorsObject.forEach((key) => {
117
+ itemColor.push({ color: key });
118
+ });
119
+ itemName = getColorScaleData.legendColorName;
120
+ useSelectorLegend = true;
121
+ }
122
+ const colorLegend = discreteLegendUtil(itemColor, useSelectorLegend, horizontal);
123
+ let totalRect;
124
+ // Style for main horizontal legend
125
+ if (!useSelectorLegend) {
126
+ totalRect = itemColor.length;
127
+ }
128
+ // Style for color selector legend
129
+ else {
130
+ // calculate width for legend using colortable colors
131
+ if (getColorScaleData === null || getColorScaleData === void 0 ? void 0 : getColorScaleData.color) {
132
+ totalRect = getColorScaleData.color.length;
133
+ }
134
+ // calculate width for legend using d3 colors
135
+ else {
136
+ totalRect = getColorScaleData.colorsObject.length;
137
+ }
223
138
  }
224
- });
139
+ const currentDiv = select(divRef.current);
140
+ // append the title
141
+ currentDiv
142
+ .append("div")
143
+ .text(dataObjectName)
144
+ .style("color", "grey")
145
+ .style("white-space", "nowrap")
146
+ .style("overflow", "hidden")
147
+ .style("width", "150px")
148
+ .style("text-overflow", "ellipsis")
149
+ .style("margin-bottom", horizontal ? "5px" : "0px")
150
+ .style("font-size", legendFontSize && legendFontSize > 0
151
+ ? `${legendFontSize}px`
152
+ : "16px")
153
+ .style("transform", horizontal ? "none" : "translate(-69px, 80px) rotate(270deg)");
154
+ // Append svg to the div
155
+ const svgLegend = currentDiv
156
+ .style("margin", horizontal ? "5px 0px 0px 15px" : "0px 5px 0px 5px")
157
+ .style("width", legendWidth)
158
+ .append("svg")
159
+ .call(colorLegend);
160
+ svgLegend
161
+ .attr("viewBox", horizontal ? `0 0 ${totalRect} 1.5` : `0 0 2 ${totalRect}`)
162
+ .attr("preserveAspectRatio", "none")
163
+ .style("font-size", ".4")
164
+ .style("margin-left", horizontal ? "0" : "20px")
165
+ .attr("height", legendHeight)
166
+ .attr("width", horizontal
167
+ ? legendScaleSize < 200
168
+ ? 190
169
+ : legendScaleSize - 10
170
+ : "40px");
171
+ }
172
+ catch (error) {
173
+ console.error(error);
174
+ }
225
175
  });
226
176
  }
227
177
  }, [
@@ -238,7 +188,7 @@ export var DiscreteColorLegend = function (_a) {
238
188
  legendWidth,
239
189
  legendHeight,
240
190
  ]);
241
- return (React.createElement("div", { style: __assign({ position: "absolute", minHeight: "70px", borderRadius: "5px", zIndex: 999, margin: "10px" }, cssLegendStyles) },
242
- React.createElement("div", { id: id ? id : "disc-legend - ".concat(generateUniqueId), ref: divRef })));
191
+ return (React.createElement("div", { style: Object.assign({ position: "absolute", minHeight: "70px", borderRadius: "5px", zIndex: 999, margin: "10px" }, cssLegendStyles) },
192
+ React.createElement("div", { id: id ? id : `disc-legend - ${generateUniqueId}`, ref: divRef })));
243
193
  };
244
194
  //# sourceMappingURL=DiscreteLegend.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"DiscreteLegend.js","sourceRoot":"","sources":["../../../src/component/Legend/DiscreteLegend.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,MAAM,EAAE,MAAM,IAAI,CAAC;AAE5B,OAAO,kBAAkB,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AACtE,OAAO,EAAE,aAAa,EAAE,MAAM,uBAA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,IAAI,CAAC,qBAAqB,EAAE,MAAM,CAAC;iCACnC,KAAK,CAAC,WAAW,EAAE,IAAI,CAAC;iCACxB,KAAK,CAAC,aAAa,EAAE,UAAU,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC;iCAC/C,IAAI,CAAC,QAAQ,EAAE,YAAY,CAAC;iCAC5B,IAAI,CACH,OAAO,EACP,UAAU;gCACR,CAAC,CAAC,eAAe,GAAG,GAAG;oCACrB,CAAC,CAAC,GAAG;oCACL,CAAC,CAAC,eAAe,GAAG,EAAE;gCACxB,CAAC,CAAC,MAAM,CACX,CAAC;;;;4BAEJ,OAAO,CAAC,KAAK,CAAC,OAAK,CAAC,CAAC;;;;;;SAExB;IACH,CAAC,EAAE;QACD,YAAY;QACZ,SAAS;QACT,WAAW;QACX,UAAU;QACV,iBAAiB;QACjB,cAAc;QACd,cAAc;QACd,YAAY;QACZ,aAAa;QACb,eAAe;QACf,WAAW;QACX,YAAY;KACb,CAAC,CAAC;IAEH,OAAO,CACL,6BACE,KAAK,aACH,QAAQ,EAAE,UAAU,EACpB,SAAS,EAAE,MAAM,EACjB,YAAY,EAAE,KAAK,EACnB,MAAM,EAAE,GAAG,EACX,MAAM,EAAE,MAAM,IACX,eAAe;QAGpB,6BACE,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,wBAAiB,gBAAgB,CAAE,EACjD,GAAG,EAAE,MAAM,GACN,CACH,CACP,CAAC;AACJ,CAAC,CAAC"}
1
+ {"version":3,"file":"DiscreteLegend.js","sourceRoot":"","sources":["../../../src/component/Legend/DiscreteLegend.tsx"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,MAAM,EAAE,MAAM,IAAI,CAAC;AAE5B,OAAO,kBAAkC,MAAM,yBAAyB,CAAC;AACzE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,CAAC,CAAC;oBAErB,SAAS;yBACN,IAAI,CACH,SAAS,EACT,UAAU,CAAC,CAAC,CAAC,OAAO,SAAS,MAAM,CAAC,CAAC,CAAC,SAAS,SAAS,EAAE,CAC3D;yBACA,IAAI,CAAC,qBAAqB,EAAE,MAAM,CAAC;yBACnC,KAAK,CAAC,WAAW,EAAE,IAAI,CAAC;yBACxB,KAAK,CAAC,aAAa,EAAE,UAAU,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC;yBAC/C,IAAI,CAAC,QAAQ,EAAE,YAAY,CAAC;yBAC5B,IAAI,CACH,OAAO,EACP,UAAU;wBACR,CAAC,CAAC,eAAe,GAAG,GAAG;4BACrB,CAAC,CAAC,GAAG;4BACL,CAAC,CAAC,eAAe,GAAG,EAAE;wBACxB,CAAC,CAAC,MAAM,CACX,CAAC;gBACN,CAAC;gBAAC,OAAO,KAAK,EAAE,CAAC;oBACf,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;gBACvB,CAAC;YACH,CAAC;SAAA;IACH,CAAC,EAAE;QACD,YAAY;QACZ,SAAS;QACT,WAAW;QACX,UAAU;QACV,iBAAiB;QACjB,cAAc;QACd,cAAc;QACd,YAAY;QACZ,aAAa;QACb,eAAe;QACf,WAAW;QACX,YAAY;KACb,CAAC,CAAC;IAEH,OAAO,CACL,6BACE,KAAK,kBACH,QAAQ,EAAE,UAAU,EACpB,SAAS,EAAE,MAAM,EACjB,YAAY,EAAE,KAAK,EACnB,MAAM,EAAE,GAAG,EACX,MAAM,EAAE,MAAM,IACX,eAAe;QAGpB,6BACE,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,iBAAiB,gBAAgB,EAAE,EACjD,GAAG,EAAE,MAAM,GACN,CACH,CACP,CAAC;AACJ,CAAC,CAAC"}
@@ -1,21 +1,10 @@
1
- var __assign = (this && this.__assign) || function () {
2
- __assign = Object.assign || function(t) {
3
- for (var s, i = 1, n = arguments.length; i < n; i++) {
4
- s = arguments[i];
5
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
- t[p] = s[p];
7
- }
8
- return t;
9
- };
10
- return __assign.apply(this, arguments);
11
- };
12
1
  import React from "react";
13
2
  import { DiscreteColorLegend, } from "./DiscreteLegend";
14
3
  export default {
15
4
  component: DiscreteColorLegend,
16
5
  title: "Legends/DiscreteColorLegend",
17
6
  };
18
- var discreteData = {
7
+ const discreteData = {
19
8
  OS: [[], 0],
20
9
  LSF: [[], 1],
21
10
  USF: [[], 2],
@@ -27,26 +16,26 @@ var discreteData = {
27
16
  MSH: [[], 8],
28
17
  CAL: [[], 9],
29
18
  };
30
- var dataObjectName = "Wells / FACIES";
31
- var horizontal = true;
32
- var colorName = "Facies";
33
- var DEFAULT_ARGS = {
34
- discreteData: discreteData,
35
- dataObjectName: dataObjectName,
36
- colorName: colorName,
37
- horizontal: horizontal,
19
+ const dataObjectName = "Wells / FACIES";
20
+ const horizontal = true;
21
+ const colorName = "Facies";
22
+ const DEFAULT_ARGS = {
23
+ discreteData,
24
+ dataObjectName,
25
+ colorName,
26
+ horizontal,
38
27
  legendScaleSize: 300,
39
28
  legendFontSize: 13,
40
29
  tickFontSize: 13,
41
30
  numberOfTicks: 3,
42
31
  };
43
- var Template = function (args) {
44
- return React.createElement(DiscreteColorLegend, __assign({}, args));
32
+ const Template = (args) => {
33
+ return React.createElement(DiscreteColorLegend, Object.assign({}, args));
45
34
  };
46
- export var Facies = Template.bind({});
47
- Facies.args = __assign({}, DEFAULT_ARGS);
48
- export var BackgroundColor = function () {
49
- return (React.createElement(DiscreteColorLegend, __assign({}, DEFAULT_ARGS, { dataObjectName: dataObjectName, cssLegendStyles: {
35
+ export const Facies = Template.bind({});
36
+ Facies.args = Object.assign({}, DEFAULT_ARGS);
37
+ export const BackgroundColor = () => {
38
+ return (React.createElement(DiscreteColorLegend, Object.assign({}, DEFAULT_ARGS, { dataObjectName: dataObjectName, cssLegendStyles: {
50
39
  backgroundColor: "red",
51
40
  } })));
52
41
  };
@@ -1 +1 @@
1
- {"version":3,"file":"DiscreteLegend.stories.js","sourceRoot":"","sources":["../../../src/component/Legend/DiscreteLegend.stories.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAEL,mBAAmB,GAEpB,MAAM,kBAAkB,CAAC;AAE1B,eAAe;IACb,SAAS,EAAE,mBAAmB;IAC9B,KAAK,EAAE,6BAA6B;CACrC,CAAC;AAEF,IAAM,YAAY,GAAkB;IAClC,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;IACX,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;IACZ,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;IACZ,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;IACX,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;IACX,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;IACX,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;IACZ,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;IACZ,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;IACZ,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;CACb,CAAC;AACF,IAAM,cAAc,GAAG,gBAAgB,CAAC;AACxC,IAAM,UAAU,GAAG,IAAI,CAAC;AACxB,IAAM,SAAS,GAAG,QAAQ,CAAC;AAE3B,IAAM,YAAY,GAA6B;IAC7C,YAAY,cAAA;IACZ,cAAc,gBAAA;IACd,SAAS,WAAA;IACT,UAAU,YAAA;IACV,eAAe,EAAE,GAAG;IACpB,cAAc,EAAE,EAAE;IAClB,YAAY,EAAE,EAAE;IAChB,aAAa,EAAE,CAAC;CACjB,CAAC;AAEF,IAAM,QAAQ,GAAG,UAAC,IAA8B;IAC9C,OAAO,oBAAC,mBAAmB,eAAK,IAAI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CAAC;AAE3B,MAAM,YAAY,GAA6B;IAC7C,YAAY;IACZ,cAAc;IACd,SAAS;IACT,UAAU;IACV,eAAe,EAAE,GAAG;IACpB,cAAc,EAAE,EAAE;IAClB,YAAY,EAAE,EAAE;IAChB,aAAa,EAAE,CAAC;CACjB,CAAC;AAEF,MAAM,QAAQ,GAAG,CAAC,IAA8B,EAAE,EAAE;IAClD,OAAO,oBAAC,mBAAmB,oBAAK,IAAI,EAAI,CAAC;AAC3C,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,MAAM,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACxC,MAAM,CAAC,IAAI,qBACN,YAAY,CAChB,CAAC;AAEF,MAAM,CAAC,MAAM,eAAe,GAAG,GAAG,EAAE;IAClC,OAAO,CACL,oBAAC,mBAAmB,oBACd,YAAY,IAChB,cAAc,EAAE,cAAc,EAC9B,eAAe,EAAE;YACf,eAAe,EAAE,KAAK;SACvB,IACD,CACH,CAAC;AACJ,CAAC,CAAC"}
@@ -1,4 +1,4 @@
1
- export var DEFAULT_STYLE = {
1
+ export const DEFAULT_STYLE = {
2
2
  left: "0vw",
3
3
  top: "0vh",
4
4
  backgroundColor: "#A0A0A0aa",
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/component/Legend/constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,IAAM,aAAa,GAAG;IAC3B,IAAI,EAAE,KAAK;IACX,GAAG,EAAE,KAAK;IACV,eAAe,EAAE,WAAW;IAC5B,YAAY,EAAE,KAAK;CACpB,CAAC"}
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/component/Legend/constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,IAAI,EAAE,KAAK;IACX,GAAG,EAAE,KAAK;IACV,eAAe,EAAE,WAAW;IAC5B,YAAY,EAAE,KAAK;CACpB,CAAC"}
@@ -0,0 +1,3 @@
1
+ export * from "./ColorLegend";
2
+ export * from "./ContinuousLegend";
3
+ export * from "./DiscreteLegend";
@@ -0,0 +1,4 @@
1
+ export * from "./ColorLegend";
2
+ export * from "./ContinuousLegend";
3
+ export * from "./DiscreteLegend";
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/component/Legend/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import * as d3 from "d3";
2
- export var d3ColorScales = [
2
+ export const d3ColorScales = [
3
3
  {
4
4
  name: "Spectral",
5
5
  discrete: false,
@@ -1 +1 @@
1
- {"version":3,"file":"d3ColorScale.js","sourceRoot":"","sources":["../../../src/component/Utils/d3ColorScale.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AAEzB,MAAM,CAAC,IAAM,aAAa,GAAG;IAC3B;QACE,IAAI,EAAE,UAAU;QAChB,QAAQ,EAAE,KAAK;QACf,MAAM,EAAE,EAAE,CAAC,mBAAmB;KAC/B;IACD;QACE,IAAI,EAAE,QAAQ;QACd,QAAQ,EAAE,KAAK;QACf,MAAM,EAAE,EAAE,CAAC,iBAAiB;KAC7B;IACD;QACE,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,KAAK;QACf,MAAM,EAAE,EAAE,CAAC,eAAe;KAC3B;IACD;QACE,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,KAAK;QACf,MAAM,EAAE,EAAE,CAAC,eAAe;KAC3B;IACD;QACE,IAAI,EAAE,SAAS;QACf,QAAQ,EAAE,KAAK;QACf,MAAM,EAAE,EAAE,CAAC,kBAAkB;KAC9B;IACD;QACE,IAAI,EAAE,SAAS;QACf,QAAQ,EAAE,KAAK;QACf,MAAM,EAAE,EAAE,CAAC,kBAAkB;KAC9B;IACD;QACE,IAAI,EAAE,OAAO;QACb,QAAQ,EAAE,IAAI;QACd,MAAM,EAAE,EAAE,CAAC,WAAW;KACvB;IACD;QACE,IAAI,EAAE,QAAQ;QACd,QAAQ,EAAE,IAAI;QACd,MAAM,EAAE,EAAE,CAAC,YAAY;KACxB;IACD;QACE,IAAI,EAAE,SAAS;QACf,QAAQ,EAAE,IAAI;QACd,MAAM,EAAE,EAAE,CAAC,aAAa;KACzB;IACD;QACE,IAAI,EAAE,SAAS;QACf,QAAQ,EAAE,IAAI;QACd,MAAM,EAAE,EAAE,CAAC,aAAa;KACzB;IACD;QACE,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,IAAI;QACd,MAAM,EAAE,EAAE,CAAC,UAAU;KACtB;IACD;QACE,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,IAAI;QACd,MAAM,EAAE,EAAE,CAAC,UAAU;KACtB;IACD;QACE,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,IAAI;QACd,MAAM,EAAE,EAAE,CAAC,UAAU;KACtB;IACD;QACE,IAAI,EAAE,WAAW;QACjB,QAAQ,EAAE,IAAI;QACd,MAAM,EAAE,EAAE,CAAC,eAAe;KAC3B;IACD;QACE,IAAI,EAAE,YAAY;QAClB,QAAQ,EAAE,IAAI;QACd,MAAM,EAAE,EAAE,CAAC,gBAAgB;KAC5B;CACF,CAAC"}
1
+ {"version":3,"file":"d3ColorScale.js","sourceRoot":"","sources":["../../../src/component/Utils/d3ColorScale.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AAEzB,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B;QACE,IAAI,EAAE,UAAU;QAChB,QAAQ,EAAE,KAAK;QACf,MAAM,EAAE,EAAE,CAAC,mBAAmB;KAC/B;IACD;QACE,IAAI,EAAE,QAAQ;QACd,QAAQ,EAAE,KAAK;QACf,MAAM,EAAE,EAAE,CAAC,iBAAiB;KAC7B;IACD;QACE,IAAI,EA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 +1,5 @@
1
- declare type ItemColor = {
1
+ export type NamedColor = {
2
2
  color: string;
3
3
  name?: string;
4
4
  };
5
- export default function discreteLegendUtil(itemColor: ItemColor[], isSelectorLegend?: boolean, horizontal?: boolean): any;
6
- export {};
5
+ export default function discreteLegendUtil(itemColor: NamedColor[], isSelectorLegend?: boolean, horizontal?: boolean): any;
@@ -1 +1 @@
1
- {"version":3,"file":"discreteLegend.js","sourceRoot":"","sources":["../../../src/component/Utils/discreteLegend.ts"],"names":[],"mappings":"AAKA,MAAM,CAAC,OAAO,UAAU,kBAAkB,CACxC,SAAsB,EACtB,gBAA0B,EAC1B,UAAoB;IAEpB,SAAS,MAAM,CAAC,CAAM;QACpB,SAAS,UAAU;YACjB,yBAAyB;YACzB,oCAAoC;YACpC,CAAC,CAAC,SAAS,CAAC,eAAe,CAAC;iBACzB,IAAI,CAAC,SAAS,CAAC;iBACf,KAAK,EAAE;iBACP,MAAM,CAAC,GAAG,CAAC;iBACX,MAAM,CAAC,MAAM,CAAC;iBACd,MAAM,CAAC,OAAO,CAAC;iBACf,IAAI,CAAC,UAAU,CAA0B;gBACxC,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC;YACnB,CAAC,CAAC;iBACD,IAAI,CAAC,OAAO,EAAE,WAAW,CAAC;iBAC1B,KAAK,CAAC,QAAQ,EAAE,SAAS,CAAC;iBAC1B,KAAK,CAAC,gBAAgB,EAAE,KAAK,CAAC,CAAC;YAClC,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC;iBAChB,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;iBACjB,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC;iBAChB,KAAK,CAAC,MAAM,EAAE,UAAU,CAA0B;gBACjD,OAAO,CAAC,CAAC,OAAO,CAAC,CAAC;YACpB,CAAC,CAAC,CAAC;YACL,IACE,CAAC,UAAU,IAAI,CAAC,gBAAgB,CAAC;gBACjC,CAAC,UAAU,KAAK,IAAI,IAAI,gBAAgB,CAAC,EACzC,CAAC;gBACD,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC;qBAChB,IAAI,CAAC,GAAG,EAAE,UAAU,EAAU,EAAE,CAAS;oBACxC,OAAO,CAAC,CAAC;gBACX,CAAC,CAAC;qBACD,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;YAClB,CAAC;iBAAM,IACL,CAAC,CAAC,UAAU,IAAI,CAAC,gBAAgB,CAAC;gBAClC,CAAC,UAAU,KAAK,KAAK,IAAI,gBAAgB,CAAC,EAC1C,CAAC;gBACD,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC;qBAChB,IAAI,CAAC,GAAG,EAAE,UAAU,EAAU,EAAE,CAAS;oBACxC,OAAO,CAAC,CAAC;gBACX,CAAC,CAAC;qBACD,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;YAClB,CAAC;iBAAM,CAAC;gBACN,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC;qBAChB,IAAI,CAAC,GAAG,EAAE,UAAU,EAAU,EAAE,CAAS;oBACxC,OAAO,CAAC,CAAC;gBACX,CAAC,CAAC;qBACD,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;YAClB,CAAC;QACH,CAAC;QAED,UAAU,EAAE,CAAC;IACf,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC"}
1
+ {"version":3,"file":"discreteLegend.js","sourceRoot":"","sources":["../../../src/component/Utils/discreteLegend.ts"],"names":[],"mappings":"AAKA,MAAM,CAAC,OAAO,UAAU,kBAAkB,CACxC,SAAuB,EACvB,gBAA0B,EAC1B,UAAoB;IAEpB,SAAS,MAAM,CAAC,CAAM;QACpB,SAAS,UAAU;YACjB,yBAAyB;YACzB,oCAAoC;YACpC,CAAC,CAAC,SAAS,CAAC,eAAe,CAAC;iBACzB,IAAI,CAAC,SAAS,CAAC;iBACf,KAAK,EAAE;iBACP,MAAM,CAAC,GAAG,CAAC;iBACX,MAAM,CAAC,MAAM,CAAC;iBACd,M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