@emerson-eps/color-tables 0.4.22 → 0.4.23

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.
@@ -12,7 +12,7 @@ declare type ColorLegendProps = {
12
12
  objects: Record<string, [number[], number]>;
13
13
  };
14
14
  getColorName?: any;
15
- reverseRange?: boolean;
15
+ invertLegend?: boolean;
16
16
  getColorRange?: any;
17
17
  getBreakpointValue?: any;
18
18
  getScale?: any;
@@ -7,7 +7,7 @@ import { d3ColorScales } from "../Utils/d3ColorScale";
7
7
  // Todo: Adapt it for other layers too
8
8
  export var ColorLegend = function (_a) {
9
9
  var _b;
10
- var position = _a.position, horizontal = _a.horizontal, colorTables = _a.colorTables, min = _a.min, max = _a.max, dataObjectName = _a.dataObjectName, colorName = _a.colorName, discreteData = _a.discreteData, getColorName = _a.getColorName, reverseRange = _a.reverseRange, getColorRange = _a.getColorRange, getBreakpointValue = _a.getBreakpointValue, getScale = _a.getScale;
10
+ var position = _a.position, horizontal = _a.horizontal, colorTables = _a.colorTables, min = _a.min, max = _a.max, dataObjectName = _a.dataObjectName, colorName = _a.colorName, discreteData = _a.discreteData, getColorName = _a.getColorName, invertLegend = _a.invertLegend, getColorRange = _a.getColorRange, getBreakpointValue = _a.getBreakpointValue, getScale = _a.getScale;
11
11
  var generateUniqueId = Math.ceil(Math.random() * 9999).toString();
12
12
  var divRef = useRef(null);
13
13
  var _c = React.useState(false), isOpen = _c[0], setIsOpen = _c[1];
@@ -85,8 +85,8 @@ export var ColorLegend = function (_a) {
85
85
  }, [getColorName]);
86
86
  return (React.createElement("div", null,
87
87
  React.createElement("div", { ref: divRef, onClick: toggleColorSelector },
88
- isCont === true && (React.createElement(ContinuousLegend, { min: newMin && isAuto === false ? newMin : min, max: newMax && !isAuto ? newMax : max, dataObjectName: dataObjectName, position: position, colorName: colorName, horizontal: horizontal, getColorScaleData: getColorScaleData, id: generateUniqueId, colorTables: colorTables, reverseRange: reverseRange, breakPoint: breakValue && isNone === false ? breakValue : [], editedBreakPointValues: getItemColor })),
89
- isCont === false && (React.createElement(DiscreteColorLegend, { discreteData: discreteData, dataObjectName: dataObjectName, position: position, colorName: colorName, horizontal: horizontal, getColorScaleData: getColorScaleData, id: generateUniqueId, colorTables: colorTables }))),
88
+ isCont === true && (React.createElement(ContinuousLegend, { min: newMin && isAuto === false ? newMin : min, max: newMax && !isAuto ? newMax : max, dataObjectName: dataObjectName, position: position, colorName: colorName, horizontal: horizontal, getColorScaleData: getColorScaleData, id: generateUniqueId, colorTables: colorTables, invertLegend: invertLegend, breakPoint: breakValue && isNone === false ? breakValue : [], editedBreakPointValues: getItemColor })),
89
+ isCont === false && (React.createElement(DiscreteColorLegend, { discreteData: discreteData, dataObjectName: dataObjectName, position: position, colorName: colorName, horizontal: horizontal, getColorScaleData: getColorScaleData, id: generateUniqueId, colorTables: colorTables, invertLegend: invertLegend }))),
90
90
  React.createElement("div", null, isOpen && (React.createElement(ColorSelectorAccordion, { isHorizontal: horizontal, colorTables: colorTables, getRange: getRange, isCont: isCont, getBreakpoint: getBreakpoint, getEditedBreakPoint: breakpointValues, newColorScaleData: getSelectedColorScale, currentLegendName: ((_b = getColorScaleData === null || getColorScaleData === void 0 ? void 0 : getColorScaleData.color) === null || _b === void 0 ? void 0 : _b.length) > 0
91
91
  ? getColorScaleData.name
92
92
  : colorName })))));
@@ -1 +1 @@
1
- {"version":3,"file":"ColorLegend.js","sourceRoot":"","sources":["../../../src/component/Legend/ColorLegend.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,sBAAsB,EAAE,MAAM,yCAAyC,CAAC;AACjF,OAAO,EAAE,aAAa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AClC,CAAC,CAAC,iBAAiB,CAAC,IAAI;gBACxB,CAAC,CAAC,SAAS,GAEf,CACH,CACG,CACF,CACP,CAAC;AACJ,CAAC,CAAC"}
@@ -52,7 +52,7 @@ declare type continuousLegendProps = {
52
52
  /**
53
53
  * Reverse the range(min and max)
54
54
  */
55
- reverseRange?: boolean;
55
+ invertLegend?: boolean;
56
56
  isAuto?: boolean;
57
57
  breakPoint?: any;
58
58
  editedBreakPointValues?: any;
@@ -43,7 +43,7 @@ import { color } from "d3-color";
43
43
  import { range } from "d3";
44
44
  import defaultColorTables from "../color-tables.json";
45
45
  export var ContinuousLegend = function (_a) {
46
- var min = _a.min, max = _a.max, dataObjectName = _a.dataObjectName, position = _a.position, _b = _a.colorName, colorName = _b === void 0 ? "Rainbow" : _b, horizontal = _a.horizontal, getColorScaleData = _a.getColorScaleData, id = _a.id, _c = _a.colorTables, colorTables = _c === void 0 ? defaultColorTables : _c, colorMapFunction = _a.colorMapFunction, reverseRange = _a.reverseRange, breakPoint = _a.breakPoint, editedBreakPointValues = _a.editedBreakPointValues;
46
+ var min = _a.min, max = _a.max, dataObjectName = _a.dataObjectName, position = _a.position, _b = _a.colorName, colorName = _b === void 0 ? "Rainbow" : _b, horizontal = _a.horizontal, getColorScaleData = _a.getColorScaleData, id = _a.id, _c = _a.colorTables, colorTables = _c === void 0 ? defaultColorTables : _c, colorMapFunction = _a.colorMapFunction, invertLegend = _a.invertLegend, breakPoint = _a.breakPoint, editedBreakPointValues = _a.editedBreakPointValues;
47
47
  var generateUniqueId = Math.ceil(Math.random() * 9999).toString();
48
48
  var divRef = useRef(null);
49
49
  React.useEffect(function () {
@@ -175,15 +175,15 @@ export var ContinuousLegend = function (_a) {
175
175
  .append("linearGradient")
176
176
  .attr("id", currentIndex);
177
177
  // append a linearGradient element to the defs and give it a unique id
178
- if ((horizontal && !reverseRange) || (!horizontal && reverseRange)) {
178
+ if ((horizontal && !invertLegend) || (!horizontal && invertLegend)) {
179
179
  linearGradient
180
180
  .attr("x1", "0%")
181
181
  .attr("x2", horizontal ? "100%" : "0%")
182
182
  .attr("y1", "0%")
183
183
  .attr("y2", horizontal ? "0%" : "100%");
184
184
  }
185
- else if ((!horizontal && !reverseRange) ||
186
- (horizontal && reverseRange)) {
185
+ else if ((!horizontal && !invertLegend) ||
186
+ (horizontal && invertLegend)) {
187
187
  linearGradient
188
188
  .attr("x1", horizontal ? "100%" : "0%")
189
189
  .attr("x2", "0%")
@@ -222,10 +222,10 @@ export var ContinuousLegend = function (_a) {
222
222
  .style("font-size", "small")
223
223
  .text(dataObjectName);
224
224
  xLeg = scaleLinear()
225
- .domain(reverseRange ? [max, min] : [min, max])
225
+ .domain(invertLegend ? [max, min] : [min, max])
226
226
  .range([10, 158]);
227
227
  yLeg = scaleLinear()
228
- .domain(reverseRange ? [min, max] : [max, min])
228
+ .domain(invertLegend ? [min, max] : [max, min])
229
229
  .range([10, 158]);
230
230
  horizontalAxisLeg = axisBottom(xLeg).tickValues(xLeg.ticks(0).concat(xLeg.domain(), (min + max) / 2));
231
231
  VerticalAxisLeg = axisRight(yLeg).tickValues(yLeg.ticks(0).concat(yLeg.domain(), (min + max) / 2));
@@ -257,7 +257,7 @@ export var ContinuousLegend = function (_a) {
257
257
  colorMapFunction,
258
258
  dataObjectName,
259
259
  id,
260
- reverseRange,
260
+ invertLegend,
261
261
  ]);
262
262
  return (React.createElement("div", { style: {
263
263
  right: position ? position[0] : " ",
@@ -11,7 +11,7 @@ declare const _default: ComponentMeta<React.FC<{
11
11
  id?: string;
12
12
  colorTables?: import("../colorTableTypes").colorTablesArray;
13
13
  colorMapFunction?: any;
14
- reverseRange?: boolean;
14
+ invertLegend?: boolean;
15
15
  isAuto?: boolean;
16
16
  breakPoint?: any;
17
17
  editedBreakPointValues?: any;
@@ -39,6 +39,7 @@ declare type discreteLegendProps = {
39
39
  * Reference: https://github.com/emerson-eps/color-tables/blob/main/react-app/src/component/color-tables.json
40
40
  */
41
41
  colorTables: colorTablesArray | string;
42
+ invertLegend?: boolean;
42
43
  };
43
44
  export declare const DiscreteColorLegend: React.FC<discreteLegendProps>;
44
45
  export declare function RGBToHex(rgb: number[]): string;
@@ -41,7 +41,7 @@ import { select, scaleOrdinal } from "d3";
41
41
  import { colorsArray } from "../Utils/legendCommonFunction";
42
42
  import { d3ColorScales } from "../Utils/d3ColorScale";
43
43
  export var DiscreteColorLegend = function (_a) {
44
- var discreteData = _a.discreteData, dataObjectName = _a.dataObjectName, position = _a.position, _b = _a.colorName, colorName = _b === void 0 ? "Stratigraphy" : _b, horizontal = _a.horizontal, getColorScaleData = _a.getColorScaleData, id = _a.id, colorTables = _a.colorTables;
44
+ var discreteData = _a.discreteData, dataObjectName = _a.dataObjectName, position = _a.position, _b = _a.colorName, colorName = _b === void 0 ? "Stratigraphy" : _b, horizontal = _a.horizontal, getColorScaleData = _a.getColorScaleData, id = _a.id, colorTables = _a.colorTables, invertLegend = _a.invertLegend;
45
45
  var generateUniqueId = Math.ceil(Math.random() * 9999).toString();
46
46
  var divRef = useRef(null);
47
47
  React.useEffect(function () {
@@ -52,7 +52,7 @@ export var DiscreteColorLegend = function (_a) {
52
52
  }
53
53
  function discreteLegend() {
54
54
  return __awaiter(this, void 0, void 0, function () {
55
- var dataSet, useSelectorLegend, itemName, itemColor, res, arrayOfColors_1, d3ColorArrays_1, ordinalValues, colorLegend, currentDiv, totalRect, svgLegend, error_1;
55
+ var dataSet, useSelectorLegend, itemName, itemColor, res, arrayOfColors_1, d3ColorArrays_1, ordinalValues, colorLegend, totalRect, currentDiv, svgLegend, error_1;
56
56
  return __generator(this, function (_a) {
57
57
  switch (_a.label) {
58
58
  case 0:
@@ -121,8 +121,23 @@ export var DiscreteColorLegend = function (_a) {
121
121
  }
122
122
  ordinalValues = scaleOrdinal().domain(itemName);
123
123
  colorLegend = discreteLegendUtil(itemColor, useSelectorLegend, horizontal).inputScale(ordinalValues);
124
- currentDiv = select(divRef.current);
125
124
  totalRect = void 0;
125
+ // Style for main horizontal legend
126
+ if (!useSelectorLegend) {
127
+ totalRect = itemColor.length;
128
+ }
129
+ // Style for color selector legend
130
+ else {
131
+ // calculate width for legend using colortable colors
132
+ if (getColorScaleData === null || getColorScaleData === void 0 ? void 0 : getColorScaleData.color) {
133
+ totalRect = getColorScaleData.color.length;
134
+ }
135
+ // calculate width for legend using d3 colors
136
+ else {
137
+ totalRect = getColorScaleData.colorsObject.length;
138
+ }
139
+ }
140
+ currentDiv = select(divRef.current);
126
141
  // append the title
127
142
  currentDiv
128
143
  .append("div")
@@ -133,28 +148,23 @@ export var DiscreteColorLegend = function (_a) {
133
148
  .style("width", "150px")
134
149
  .style("text-overflow", "ellipsis")
135
150
  .style("margin-bottom", horizontal ? "5px" : "0px")
136
- .style("transform", "none")
137
151
  .style("font-size", "small")
138
152
  .style("transform", horizontal ? "none" : "translate(-69px, 80px) rotate(270deg)");
139
153
  svgLegend = currentDiv
140
154
  .style("margin", horizontal ? "5px 0px 0px 15px" : "0px 5px 0px 5px")
141
155
  .style("width", horizontal ? "145px" : "50px")
142
156
  .append("svg")
157
+ // .style("transform", invertLegend && horizontal ? "translate(0px, -9px) rotate(180deg)" : "none")
158
+ // .style("transform", invertLegend && !horizontal ? "translate(0px, -9px) rotate(180deg)" : "none")
143
159
  .call(colorLegend);
144
- // Style for main horizontal legend
145
- if (!useSelectorLegend) {
146
- totalRect = itemColor.length;
160
+ if (invertLegend && horizontal) {
161
+ svgLegend.style("transform", "translate(0px, -9px) rotate(180deg)");
162
+ }
163
+ else if (invertLegend && !horizontal) {
164
+ svgLegend.style("transform", "translate(-20px, 0px) rotate(180deg)");
147
165
  }
148
- // Style for color selector legend
149
166
  else {
150
- // calculate width for legend using colortable colors
151
- if (getColorScaleData === null || getColorScaleData === void 0 ? void 0 : getColorScaleData.color) {
152
- totalRect = getColorScaleData.color.length;
153
- }
154
- // calculate width for legend using d3 colors
155
- else {
156
- totalRect = getColorScaleData.colorsObject.length;
157
- }
167
+ svgLegend.style("transform", "none");
158
168
  }
159
169
  svgLegend
160
170
  .attr("viewBox", horizontal ? "0 0 ".concat(totalRect, " 1.5") : "0 0 2 ".concat(totalRect))
@@ -180,6 +190,7 @@ export var DiscreteColorLegend = function (_a) {
180
190
  horizontal,
181
191
  getColorScaleData,
182
192
  dataObjectName,
193
+ invertLegend,
183
194
  ]);
184
195
  return (React.createElement("div", { style: {
185
196
  right: position ? position[0] : " ",
@@ -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;AAC/B,OAAO,kBAAkB,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AA+CtD,MAAM,CAAC,IAAM,mBAAmB,GAAkC,UAAC,EAS7C;QARpB,YAAY,kBAAA,EACZ,cAAc,oBAAA,EACd,QAAQ,cAAA,EACR,iBAA0B,EAA1B,SAAS,mBAAG,cAAc,KAAA,EAC1B,UAAU,gBAAA,EACV,iBAAiB,uBAAA,EACjB,EAAE,QAAA,EACF,WAAW,iBAAA;IAEX,IAAM,gBAAgB,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,IAAI,CAAC,CAAC,QAAQ,EAAE,CAAC;IACpE,IAAM,MAAM,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAC;IAE5C,KAAK,CAAC,SAAS,CAAC;QACd,IAAI,MAAM,CAAC,OAAO,EAAE;YAClB,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,C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;IAChC,IAAI,CAAC,CAAC,MAAM,KAAK,CAAC;QAAE,CAAC,GAAG,GAAG,GAAG,CAAC,CAAC;IAChC,IAAI,CAAC,CAAC,MAAM,KAAK,CAAC;QAAE,CAAC,GAAG,GAAG,GAAG,CAAC,CAAC;IAChC,OAAO,GAAG,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AACzB,CAAC;AAED,mBAAmB,CAAC,YAAY,GAAG;IACjC,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC;CAClB,CAAC"}
@@ -11,7 +11,7 @@ declare const _default: ComponentMeta<React.FC<{
11
11
  id?: string;
12
12
  colorTables?: import("../colorTableTypes").colorTablesArray;
13
13
  colorMapFunction?: any;
14
- reverseRange?: boolean;
14
+ invertLegend?: boolean;
15
15
  isAuto?: boolean;
16
16
  breakPoint?: any;
17
17
  editedBreakPointValues?: any;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@emerson-eps/color-tables",
3
- "version": "0.4.22",
3
+ "version": "0.4.23",
4
4
  "description": "Standard library of color tables for geological domain",
5
5
  "release": {
6
6
  "branches": [