@emerson-eps/color-tables 1.0.12 → 1.0.14

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 (84) hide show
  1. package/dist/component/BreakPoint/Canvas.js +3 -15
  2. package/dist/component/BreakPoint/Canvas.js.map +1 -1
  3. package/dist/component/BreakPoint/ColorScale.js +1 -1
  4. package/dist/component/BreakPoint/ColorScale.js.map +1 -1
  5. package/dist/component/BreakPoint/index.d.ts +1 -1
  6. package/dist/component/BreakPoint/index.js.map +1 -1
  7. package/dist/component/ColorSelector/BreakPointModule.js +13 -6
  8. package/dist/component/ColorSelector/BreakPointModule.js.map +1 -1
  9. package/dist/component/ColorSelector/ColorSelectorAccordion.js +10 -11
  10. package/dist/component/ColorSelector/ColorSelectorAccordion.js.map +1 -1
  11. package/dist/component/ColorSelector/ColorSelectorComponent.js +4 -5
  12. package/dist/component/ColorSelector/ColorSelectorComponent.js.map +1 -1
  13. package/dist/component/ColorSelector/ColorSelectorWrapper.js +13 -13
  14. package/dist/component/ColorSelector/ColorSelectorWrapper.js.map +1 -1
  15. package/dist/component/ColorSelector/index.d.ts +1 -1
  16. package/dist/component/Legend/ColorLegend.js +7 -9
  17. package/dist/component/Legend/ColorLegend.js.map +1 -1
  18. package/dist/component/Legend/ColorLegend.stories.d.ts +13 -14
  19. package/dist/component/Legend/ColorLegend.stories.js +85 -32
  20. package/dist/component/Legend/ColorLegend.stories.js.map +1 -1
  21. package/dist/component/Legend/ContinuousLegend.js +221 -229
  22. package/dist/component/Legend/ContinuousLegend.js.map +1 -1
  23. package/dist/component/Legend/ContinuousLegend.stories.d.ts +15 -10
  24. package/dist/component/Legend/ContinuousLegend.stories.js +147 -18
  25. package/dist/component/Legend/ContinuousLegend.stories.js.map +1 -1
  26. package/dist/component/Legend/DiscreteLegend.js +129 -133
  27. package/dist/component/Legend/DiscreteLegend.js.map +1 -1
  28. package/dist/component/Legend/DiscreteLegend.stories.d.ts +14 -9
  29. package/dist/component/Legend/DiscreteLegend.stories.js +178 -16
  30. package/dist/component/Legend/DiscreteLegend.stories.js.map +1 -1
  31. package/dist/component/Utils/Utils.stories.d.ts +7 -0
  32. package/dist/component/Utils/Utils.stories.js +41 -0
  33. package/dist/component/Utils/Utils.stories.js.map +1 -0
  34. package/dist/component/Utils/legendCommonFunction.js +40 -48
  35. package/dist/component/Utils/legendCommonFunction.js.map +1 -1
  36. package/package.json +11 -17
  37. package/dist/component/Utils/legendCommonFunction.stories.d.ts +0 -8
  38. package/dist/component/Utils/legendCommonFunction.stories.js +0 -35
  39. package/dist/component/Utils/legendCommonFunction.stories.js.map +0 -1
  40. package/dist/stories/ColorLegends/ContinousLegends/MD.stories.d.ts +0 -7
  41. package/dist/stories/ColorLegends/ContinousLegends/MD.stories.js +0 -34
  42. package/dist/stories/ColorLegends/ContinousLegends/MD.stories.js.map +0 -1
  43. package/dist/stories/ColorLegends/ContinousLegends/NTG.stories.d.ts +0 -7
  44. package/dist/stories/ColorLegends/ContinousLegends/NTG.stories.js +0 -34
  45. package/dist/stories/ColorLegends/ContinousLegends/NTG.stories.js.map +0 -1
  46. package/dist/stories/ColorLegends/ContinousLegends/PermTot.stories.d.ts +0 -7
  47. package/dist/stories/ColorLegends/ContinousLegends/PermTot.stories.js +0 -34
  48. package/dist/stories/ColorLegends/ContinousLegends/PermTot.stories.js.map +0 -1
  49. package/dist/stories/ColorLegends/ContinousLegends/Permeability.stories.d.ts +0 -7
  50. package/dist/stories/ColorLegends/ContinousLegends/Permeability.stories.js +0 -36
  51. package/dist/stories/ColorLegends/ContinousLegends/Permeability.stories.js.map +0 -1
  52. package/dist/stories/ColorLegends/ContinousLegends/PoroTot.stories.d.ts +0 -7
  53. package/dist/stories/ColorLegends/ContinousLegends/PoroTot.stories.js +0 -34
  54. package/dist/stories/ColorLegends/ContinousLegends/PoroTot.stories.js.map +0 -1
  55. package/dist/stories/ColorLegends/ContinousLegends/Porosity.stories.d.ts +0 -7
  56. package/dist/stories/ColorLegends/ContinousLegends/Porosity.stories.js +0 -34
  57. package/dist/stories/ColorLegends/ContinousLegends/Porosity.stories.js.map +0 -1
  58. package/dist/stories/ColorLegends/ContinousLegends/SW.stories.d.ts +0 -7
  59. package/dist/stories/ColorLegends/ContinousLegends/SW.stories.js +0 -34
  60. package/dist/stories/ColorLegends/ContinousLegends/SW.stories.js.map +0 -1
  61. package/dist/stories/ColorLegends/DiscreteLegends/FaciesNoCalcite.stories.d.ts +0 -7
  62. package/dist/stories/ColorLegends/DiscreteLegends/FaciesNoCalcite.stories.js +0 -39
  63. package/dist/stories/ColorLegends/DiscreteLegends/FaciesNoCalcite.stories.js.map +0 -1
  64. package/dist/stories/ColorLegends/DiscreteLegends/FaultDistanceHum.stories.d.ts +0 -7
  65. package/dist/stories/ColorLegends/DiscreteLegends/FaultDistanceHum.stories.js +0 -31
  66. package/dist/stories/ColorLegends/DiscreteLegends/FaultDistanceHum.stories.js.map +0 -1
  67. package/dist/stories/ColorLegends/DiscreteLegends/FaultProximityFlag.stories.d.ts +0 -7
  68. package/dist/stories/ColorLegends/DiscreteLegends/FaultProximityFlag.stories.js +0 -31
  69. package/dist/stories/ColorLegends/DiscreteLegends/FaultProximityFlag.stories.js.map +0 -1
  70. package/dist/stories/ColorLegends/DiscreteLegends/RDE.stories.d.ts +0 -7
  71. package/dist/stories/ColorLegends/DiscreteLegends/RDE.stories.js +0 -34
  72. package/dist/stories/ColorLegends/DiscreteLegends/RDE.stories.js.map +0 -1
  73. package/dist/stories/ColorLegends/DiscreteLegends/RDE_Orig.stories.d.ts +0 -7
  74. package/dist/stories/ColorLegends/DiscreteLegends/RDE_Orig.stories.js +0 -45
  75. package/dist/stories/ColorLegends/DiscreteLegends/RDE_Orig.stories.js.map +0 -1
  76. package/dist/stories/ColorLegends/DiscreteLegends/ZoneMain.stories.d.ts +0 -7
  77. package/dist/stories/ColorLegends/DiscreteLegends/ZoneMain.stories.js +0 -34
  78. package/dist/stories/ColorLegends/DiscreteLegends/ZoneMain.stories.js.map +0 -1
  79. package/dist/stories/ColorLegends/DiscreteLegends/Zonelog.stories.d.ts +0 -7
  80. package/dist/stories/ColorLegends/DiscreteLegends/Zonelog.stories.js +0 -44
  81. package/dist/stories/ColorLegends/DiscreteLegends/Zonelog.stories.js.map +0 -1
  82. package/dist/stories/ColorLegends/LegendWithSelector/LegendSelector.stories.d.ts +0 -7
  83. package/dist/stories/ColorLegends/LegendWithSelector/LegendSelector.stories.js +0 -33
  84. package/dist/stories/ColorLegends/LegendWithSelector/LegendSelector.stories.js.map +0 -1
@@ -1,32 +1,161 @@
1
1
  import React from "react";
2
- import { ContinuousLegend, } from "../../component/Legend/ContinuousLegend";
3
- export default {
2
+ import { colorTables } from "..";
3
+ import { ContinuousLegend } from ".";
4
+ // storybook page
5
+ const meta = {
6
+ title: "Legends/ContinousLegend",
4
7
  component: ContinuousLegend,
5
- title: "Legends / ContinuousLegend",
8
+ decorators: [
9
+ (Story) => {
10
+ return React.createElement(Story, null);
11
+ },
12
+ ],
6
13
  };
7
- const min = 0;
8
- const max = 1;
9
- const dataObjectName = "Physics color map";
10
- const colorName = "Physics";
14
+ export default meta;
11
15
  const DEFAULT_ARGS = {
12
- min: min,
13
- max: max,
16
+ min: 0,
17
+ max: 1,
14
18
  isRangeShown: true,
15
19
  legendFontSize: 13,
16
20
  tickFontSize: 13,
17
21
  numberOfTicks: 3,
18
22
  legendScaleSize: 300,
19
23
  };
20
- const Story = (args) => {
21
- return React.createElement(ContinuousLegend, Object.assign({}, args));
24
+ const cssLegendStyles = { top: "0%", left: "0%" };
25
+ export const StandardColorTableLibrary = {
26
+ args: {
27
+ ...DEFAULT_ARGS,
28
+ dataObjectName: "Physics color map",
29
+ colorName: "Physics",
30
+ cssLegendStyles,
31
+ },
22
32
  };
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: {
33
+ export const DefaultColorTable = {
34
+ args: {
35
+ ...DEFAULT_ARGS,
36
+ dataObjectName: "Default color table (Rainbow)",
37
+ },
38
+ };
39
+ export const BackgroundColor = {
40
+ args: {
41
+ ...DEFAULT_ARGS,
42
+ dataObjectName: "Physics color map",
43
+ cssLegendStyles: {
29
44
  backgroundColor: "red",
30
- } })));
45
+ },
46
+ },
47
+ };
48
+ export const MDTemplate = {
49
+ args: {
50
+ min: 2917,
51
+ max: 4723,
52
+ dataObjectName: "Wells / MD",
53
+ colorName: "Time/Depth",
54
+ colorTables,
55
+ horizontal: true,
56
+ isRangeShown: true,
57
+ legendFontSize: 13,
58
+ tickFontSize: 13,
59
+ numberOfTicks: 3,
60
+ legendScaleSize: 300,
61
+ cssLegendStyles,
62
+ },
63
+ };
64
+ export const NTGTemplate = {
65
+ args: {
66
+ min: 0,
67
+ max: 1,
68
+ dataObjectName: "Wells / NTG",
69
+ colorName: "Rainbow",
70
+ colorTables,
71
+ horizontal: true,
72
+ isRangeShown: true,
73
+ legendFontSize: 13,
74
+ tickFontSize: 13,
75
+ numberOfTicks: 3,
76
+ legendScaleSize: 300,
77
+ cssLegendStyles,
78
+ },
79
+ };
80
+ export const PermeabilityTemplate = {
81
+ args: {
82
+ min: 2782,
83
+ max: 3513,
84
+ dataObjectName: "Wells / PERM",
85
+ colorName: "Permeability",
86
+ colorTables,
87
+ horizontal: true,
88
+ colorMapFunction: (x) => [255 - x * 100, 255 - x * 100, 255 * x],
89
+ isRangeShown: true,
90
+ legendFontSize: 13,
91
+ tickFontSize: 13,
92
+ numberOfTicks: 3,
93
+ legendScaleSize: 300,
94
+ cssLegendStyles,
95
+ },
96
+ };
97
+ export const PermTotTemplate = {
98
+ args: {
99
+ min: -999,
100
+ max: 14023,
101
+ dataObjectName: "Wells / PERMTOT",
102
+ colorName: "Porosity",
103
+ colorTables,
104
+ horizontal: true,
105
+ isRangeShown: true,
106
+ legendFontSize: 13,
107
+ tickFontSize: 13,
108
+ numberOfTicks: 3,
109
+ legendScaleSize: 300,
110
+ cssLegendStyles,
111
+ },
112
+ };
113
+ export const PorosityTemplate = {
114
+ args: {
115
+ min: 0,
116
+ max: 0.35,
117
+ dataObjectName: "Wells / PORO",
118
+ colorName: "Porosity",
119
+ colorTables,
120
+ horizontal: true,
121
+ isRangeShown: true,
122
+ legendFontSize: 13,
123
+ tickFontSize: 13,
124
+ numberOfTicks: 3,
125
+ legendScaleSize: 300,
126
+ cssLegendStyles,
127
+ },
128
+ };
129
+ export const PoroTotTemplate = {
130
+ args: {
131
+ min: 0,
132
+ max: 0.35,
133
+ dataObjectName: "Wells / POROTOT",
134
+ colorName: "Porosity",
135
+ colorTables,
136
+ horizontal: true,
137
+ isRangeShown: true,
138
+ legendFontSize: 13,
139
+ tickFontSize: 13,
140
+ numberOfTicks: 3,
141
+ legendScaleSize: 300,
142
+ cssLegendStyles,
143
+ },
144
+ };
145
+ export const SWTemplate = {
146
+ args: {
147
+ min: 0,
148
+ max: 1,
149
+ dataObjectName: "Wells / SW",
150
+ colorName: "Rainbow",
151
+ colorTables,
152
+ horizontal: true,
153
+ isRangeShown: true,
154
+ legendFontSize: 13,
155
+ tickFontSize: 13,
156
+ numberOfTicks: 3,
157
+ legendScaleSize: 300,
158
+ cssLegendStyles,
159
+ },
31
160
  };
32
161
  //# sourceMappingURL=ContinuousLegend.stories.js.map
@@ -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,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
+ {"version":3,"file":"ContinuousLegend.stories.js","sourceRoot":"","sources":["../../../src/component/Legend/ContinuousLegend.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,WA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AE,CAAC;QAChB,eAAe,EAAE,GAAG;QACpB,eAAe;KAChB;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,gBAAgB,GAAU;IACrC,IAAI,EAAE;QACJ,GAAG,EAAE,CAAC;QACN,GAAG,EAAE,IAAI;QACT,cAAc,EAAE,cAAc;QAC9B,SAAS,EAAE,UAAU;QACrB,WAAW;QACX,UAAU,EAAE,IAAI;QAChB,YAAY,EAAE,IAAI;QAClB,cAAc,EAAE,EAAE;QAClB,YAAY,EAAE,EAAE;QAChB,aAAa,EAAE,CAAC;QAChB,eAAe,EAAE,GAAG;QACpB,eAAe;KAChB;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,eAAe,GAAU;IACpC,IAAI,EAAE;QACJ,GAAG,EAAE,CAAC;QACN,GAAG,EAAE,IAAI;QACT,cAAc,EAAE,iBAAiB;QACjC,SAAS,EAAE,UAAU;QACrB,WAAW;QACX,UAAU,EAAE,IAAI;QAChB,YAAY,EAAE,IAAI;QAClB,cAAc,EAAE,EAAE;QAClB,YAAY,EAAE,EAAE;QAChB,aAAa,EAAE,CAAC;QAChB,eAAe,EAAE,GAAG;QACpB,eAAe;KAChB;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,UAAU,GAAU;IAC/B,IAAI,EAAE;QACJ,GAAG,EAAE,CAAC;QACN,GAAG,EAAE,CAAC;QACN,cAAc,EAAE,YAAY;QAC5B,SAAS,EAAE,SAAS;QACpB,WAAW;QACX,UAAU,EAAE,IAAI;QAChB,YAAY,EAAE,IAAI;QAClB,cAAc,EAAE,EAAE;QAClB,YAAY,EAAE,EAAE;QAChB,aAAa,EAAE,CAAC;QAChB,eAAe,EAAE,GAAG;QACpB,eAAe;KAChB;CACF,CAAC"}
@@ -1,12 +1,3 @@
1
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
- return new (P || (P = Promise))(function (resolve, reject) {
4
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
- step((generator = generator.apply(thisArg, _arguments || [])).next());
8
- });
9
- };
10
1
  import * as React from "react";
11
2
  import { useRef } from "react";
12
3
  import { select } from "d3";
@@ -44,135 +35,133 @@ export const DiscreteColorLegend = ({ discreteData, dataObjectName, colorName =
44
35
  select(divRef.current).select("svg").remove();
45
36
  discreteLegend();
46
37
  }
47
- function discreteLegend() {
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;
89
- });
90
- if (matchedColorsArrays)
91
- itemColor.push({
92
- color: RGBToHex(matchedColorsArrays).color,
93
- name: key,
94
- });
95
- itemName.push(key);
96
- }
97
- // for d3 colors
98
- else {
99
- const matchedColorsArrays = d3ColorArrays.find((_value, index) => {
100
- return index === code;
38
+ async function discreteLegend() {
39
+ let dataSet;
40
+ let useSelectorLegend = false;
41
+ let itemName = [];
42
+ const itemColor = [];
43
+ try {
44
+ // fix for dash wrapper
45
+ if (typeof colorTables === "string") {
46
+ const res = await fetch(colorTables);
47
+ dataSet = await res.json();
48
+ }
49
+ const arrayOfColors = typeof colorTables === "string"
50
+ ? colorsArray(colorName, dataSet)
51
+ : colorsArray(colorName, colorTables);
52
+ const d3ColorArrays = colorsArray(colorName, d3ColorScales);
53
+ // temporary fix, will be removed later
54
+ const defaultDiscreteData = {
55
+ discrete_1: [[], 0],
56
+ discrete_2: [[], 1],
57
+ discrete_3: [[], 2],
58
+ discrete_4: [[], 3],
59
+ discrete_5: [[], 4],
60
+ discrete_6: [[], 5],
61
+ discrete_7: [[], 6],
62
+ discrete_8: [[], 7],
63
+ discrete_9: [[], 8],
64
+ discrete_10: [[], 9],
65
+ };
66
+ // Main single discrete legend
67
+ if (!getColorScaleData || getColorScaleData.length === 0) {
68
+ const entries = Object.entries(discreteData ? discreteData : defaultDiscreteData);
69
+ const sorted = entries.sort((a, b) => a[1][1] - b[1][1]);
70
+ sorted.forEach((value) => {
71
+ const key = value[0];
72
+ const val = value[1];
73
+ const code = val[1];
74
+ // for colortable colors
75
+ if (arrayOfColors.length > 0) {
76
+ //compare the first value in colorarray(colortable) and code from discreteData
77
+ const matchedColorsArrays = arrayOfColors.find((value) => {
78
+ return value[0] === code;
79
+ });
80
+ if (matchedColorsArrays)
81
+ itemColor.push({
82
+ color: RGBToHex(matchedColorsArrays).color,
83
+ name: key,
101
84
  });
102
- if (matchedColorsArrays)
103
- itemColor.push({ color: matchedColorsArrays });
104
- }
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;
85
+ itemName.push(key);
133
86
  }
134
- // calculate width for legend using d3 colors
87
+ // for d3 colors
135
88
  else {
136
- totalRect = getColorScaleData.colorsObject.length;
89
+ const matchedColorsArrays = d3ColorArrays.find((_value, index) => {
90
+ return index === code;
91
+ });
92
+ if (matchedColorsArrays)
93
+ itemColor.push({ color: matchedColorsArrays });
137
94
  }
138
- }
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");
95
+ });
96
+ }
97
+ // Discrete legend using Colortable colors (color selector component)
98
+ if (getColorScaleData?.color) {
99
+ getColorScaleData.color.forEach((key) => {
100
+ itemColor.push({ color: RGBToHex(key).color });
101
+ });
102
+ useSelectorLegend = true;
103
+ }
104
+ // Discrete legend using d3 colors
105
+ if (getColorScaleData?.colorsObject) {
106
+ getColorScaleData.colorsObject.forEach((key) => {
107
+ itemColor.push({ color: key });
108
+ });
109
+ itemName = getColorScaleData.legendColorName;
110
+ useSelectorLegend = true;
171
111
  }
172
- catch (error) {
173
- console.error(error);
112
+ const colorLegend = discreteLegendUtil(itemColor, useSelectorLegend, horizontal);
113
+ let totalRect;
114
+ // Style for main horizontal legend
115
+ if (!useSelectorLegend) {
116
+ totalRect = itemColor.length;
117
+ }
118
+ // Style for color selector legend
119
+ else {
120
+ // calculate width for legend using colortable colors
121
+ if (getColorScaleData?.color) {
122
+ totalRect = getColorScaleData.color.length;
123
+ }
124
+ // calculate width for legend using d3 colors
125
+ else {
126
+ totalRect = getColorScaleData.colorsObject.length;
127
+ }
174
128
  }
175
- });
129
+ const currentDiv = select(divRef.current);
130
+ // append the title
131
+ currentDiv
132
+ .append("div")
133
+ .text(dataObjectName)
134
+ .style("color", "grey")
135
+ .style("white-space", "nowrap")
136
+ .style("overflow", "hidden")
137
+ .style("width", "150px")
138
+ .style("text-overflow", "ellipsis")
139
+ .style("margin-bottom", horizontal ? "5px" : "0px")
140
+ .style("font-size", legendFontSize && legendFontSize > 0
141
+ ? `${legendFontSize}px`
142
+ : "16px")
143
+ .style("transform", horizontal ? "none" : "translate(-69px, 80px) rotate(270deg)");
144
+ // Append svg to the div
145
+ const svgLegend = currentDiv
146
+ .style("margin", horizontal ? "5px 0px 0px 15px" : "0px 5px 0px 5px")
147
+ .style("width", legendWidth)
148
+ .append("svg")
149
+ .call(colorLegend);
150
+ svgLegend
151
+ .attr("viewBox", horizontal ? `0 0 ${totalRect} 1.5` : `0 0 2 ${totalRect}`)
152
+ .attr("preserveAspectRatio", "none")
153
+ .style("font-size", ".4")
154
+ .style("margin-left", horizontal ? "0" : "20px")
155
+ .attr("height", legendHeight)
156
+ .attr("width", horizontal
157
+ ? legendScaleSize < 200
158
+ ? 190
159
+ : legendScaleSize - 10
160
+ : "40px");
161
+ }
162
+ catch (error) {
163
+ console.error(error);
164
+ }
176
165
  }
177
166
  }, [
178
167
  discreteData,
@@ -188,7 +177,14 @@ export const DiscreteColorLegend = ({ discreteData, dataObjectName, colorName =
188
177
  legendWidth,
189
178
  legendHeight,
190
179
  ]);
191
- return (React.createElement("div", { style: Object.assign({ position: "absolute", minHeight: "70px", borderRadius: "5px", zIndex: 999, margin: "10px" }, cssLegendStyles) },
180
+ return (React.createElement("div", { style: {
181
+ position: "absolute",
182
+ minHeight: "70px",
183
+ borderRadius: "5px",
184
+ zIndex: 999,
185
+ margin: "10px",
186
+ ...cssLegendStyles,
187
+ } },
192
188
  React.createElement("div", { id: id ? id : `disc-legend - ${generateUniqueId}`, ref: divRef })));
193
189
  };
194
190
  //# 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,kBAAkC,MAAM,yBAAyB,CAAC;AACzE,OAAO,EAAE,WAAW,E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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
+ {"version":3,"file":"DiscreteLegend.js","sourceRoot":"","sources":["../../../src/component/Legend/DiscreteLegend.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK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 +1,14 @@
1
- import React from "react";
2
- import { DiscreteColorLegendProps } from "./DiscreteLegend";
3
- declare const _default: {
4
- component: React.FC<DiscreteColorLegendProps>;
5
- title: string;
6
- };
7
- export default _default;
8
- export declare const Facies: any;
9
- export declare const BackgroundColor: () => React.JSX.Element;
1
+ import { Meta, StoryObj } from "@storybook/react-vite";
2
+ import { DiscreteColorLegend } from ".";
3
+ declare const meta: Meta<typeof DiscreteColorLegend>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof DiscreteColorLegend>;
6
+ export declare const Facies: Story;
7
+ export declare const BackgroundColor: Story;
8
+ export declare const FaciesNoCalciteTemplate: Story;
9
+ export declare const FaultDistanceHumTemplate: Story;
10
+ export declare const FaultProximityFlagTemplate: Story;
11
+ export declare const RDETemplate: Story;
12
+ export declare const RDEOrigTemplate: Story;
13
+ export declare const ZonelogTemplate: Story;
14
+ export declare const ZoneMainTemplate: Story;