@emerson-eps/color-tables
Advanced tools
Comparing version 0.2.34 to 0.2.35
@@ -19,3 +19,3 @@ import * as React from "react"; | ||
React.createElement(Accordion.Panel, null, | ||
React.createElement(ColorSelectorWrapper, { useColorTableColors: true, newColorScaleData: props === null || props === void 0 ? void 0 : props.newColorScaleData })))), | ||
React.createElement(ColorSelectorWrapper, { useColorTableColors: true, newColorScaleData: props === null || props === void 0 ? void 0 : props.newColorScaleData, colorTables: props === null || props === void 0 ? void 0 : props.colorTables })))), | ||
React.createElement(Accordion, null, | ||
@@ -25,4 +25,4 @@ React.createElement(Accordion.Item, null, | ||
React.createElement(Accordion.Panel, null, | ||
React.createElement(ColorSelectorWrapper, { useColorTableColors: false, newColorScaleData: props === null || props === void 0 ? void 0 : props.newColorScaleData }))))))))); | ||
React.createElement(ColorSelectorWrapper, { useColorTableColors: false, newColorScaleData: props === null || props === void 0 ? void 0 : props.newColorScaleData, colorTables: props === null || props === void 0 ? void 0 : props.colorTables }))))))))); | ||
}; | ||
//# sourceMappingURL=ColorSelectorAccordion.js.map |
@@ -10,4 +10,5 @@ import * as React from "react"; | ||
newColorScaleData: any; | ||
colorTables: any; | ||
}; | ||
export declare const ColorSelectorWrapper: React.FC<legendProps>; | ||
export {}; |
import * as React from "react"; | ||
import colorTables from "../color-tables.json"; | ||
import { d3ColorScales } from "../Utils/d3ColorScale"; | ||
import { ColorSelectorComponent } from "./ColorSelectorComponent"; | ||
var continuosColorData = []; | ||
var continuosD3ColorData = []; | ||
var discreteColorData = []; | ||
var discreteD3ColorData = []; | ||
// Continuous legend using color table data | ||
var colorTableContinuousData = colorTables.filter(function (element) { | ||
return element.discrete == false; | ||
}); | ||
colorTableContinuousData.forEach(function (element) { | ||
continuosColorData.push({ color: element.colors, name: element.name }); | ||
}); | ||
// Continuous legend using d3 data | ||
var d3continuousData = d3ColorScales.filter(function (element) { | ||
return element.discrete == false; | ||
}); | ||
d3continuousData.forEach(function (element) { | ||
continuosD3ColorData.push({ color: element.colors, name: element.name }); | ||
}); | ||
// Discrete legend using color table data | ||
var discreteData = colorTables.filter(function (element) { | ||
return element.discrete == true; | ||
}); | ||
discreteData.forEach(function (element) { | ||
discreteColorData.push({ color: element.colors, name: element.name }); | ||
}); | ||
// Discrete legend using d3 data | ||
var d3discreteData = d3ColorScales.filter(function (element) { | ||
return element.discrete == true; | ||
}); | ||
d3discreteData.forEach(function (element) { | ||
discreteD3ColorData.push({ color: element.colors, name: element.name }); | ||
}); | ||
export var ColorSelectorWrapper = function (_a) { | ||
var useColorTableColors = _a.useColorTableColors, newColorScaleData = _a.newColorScaleData; | ||
var useColorTableColors = _a.useColorTableColors, newColorScaleData = _a.newColorScaleData, colorTables = _a.colorTables; | ||
var continuousLegend; | ||
var discreteLegend; | ||
var continuosColorData = []; | ||
var continuosD3ColorData = []; | ||
var discreteColorData = []; | ||
var discreteD3ColorData = []; | ||
// Continuous legend using color table data | ||
var colorTableContinuousData = colorTables.filter(function (element) { | ||
return element.discrete == false; | ||
}); | ||
colorTableContinuousData.forEach(function (element) { | ||
continuosColorData.push({ color: element.colors, name: element.name }); | ||
}); | ||
// Continuous legend using d3 data | ||
var d3continuousData = d3ColorScales.filter(function (element) { | ||
return element.discrete == false; | ||
}); | ||
d3continuousData.forEach(function (element) { | ||
continuosD3ColorData.push({ color: element.colors, name: element.name }); | ||
}); | ||
// Discrete legend using color table data | ||
var discreteData = colorTables.filter(function (element) { | ||
return element.discrete == true; | ||
}); | ||
discreteData.forEach(function (element) { | ||
discreteColorData.push({ color: element.colors, name: element.name }); | ||
}); | ||
// Discrete legend using d3 data | ||
var d3discreteData = d3ColorScales.filter(function (element) { | ||
return element.discrete == true; | ||
}); | ||
d3discreteData.forEach(function (element) { | ||
discreteD3ColorData.push({ color: element.colors, name: element.name }); | ||
}); | ||
// return continuous and discrete legend which uses d3 data | ||
@@ -42,0 +41,0 @@ if (!useColorTableColors) { |
import * as React from "react"; | ||
import { colorTablesArray } from "../colorTableTypes"; | ||
declare type ColorLegendProps = { | ||
colorTables: any; | ||
colorTables: colorTablesArray; | ||
min: number; | ||
@@ -5,0 +6,0 @@ max: number; |
@@ -42,6 +42,6 @@ import * as React from "react"; | ||
React.createElement("div", { ref: divRef, onClick: toggleColorSelector }, | ||
isCont == true && (React.createElement(ContinuousLegend, { min: min, max: max, dataObjectName: dataObjectName, position: position, colorName: colorName, horizontal: horizontal, updateLegend: updateLegend, id: generateUniqueId })), | ||
isCont == false && (React.createElement(DiscreteColorLegend, { discreteData: discreteData, dataObjectName: dataObjectName, position: position, colorName: colorName, horizontal: horizontal, updateLegend: updateLegend, id: generateUniqueId }))), | ||
React.createElement("div", null, isOpen && (React.createElement(ColorSelectorAccordion, { newColorScaleData: getSelectedColorScale, isHorizontal: horizontal }))))); | ||
isCont == true && (React.createElement(ContinuousLegend, { min: min, max: max, dataObjectName: dataObjectName, position: position, colorName: colorName, horizontal: horizontal, updateLegend: updateLegend, id: generateUniqueId, colorTables: colorTables })), | ||
isCont == false && (React.createElement(DiscreteColorLegend, { discreteData: discreteData, dataObjectName: dataObjectName, position: position, colorName: colorName, horizontal: horizontal, updateLegend: updateLegend, id: generateUniqueId, colorTables: colorTables }))), | ||
React.createElement("div", null, isOpen && (React.createElement(ColorSelectorAccordion, { newColorScaleData: getSelectedColorScale, isHorizontal: horizontal, colorTables: colorTables }))))); | ||
}; | ||
//# sourceMappingURL=ColorLegend.js.map |
import * as React from "react"; | ||
import { colorTablesArray } from "../colorTableTypes"; | ||
declare type continuousLegendProps = { | ||
@@ -11,4 +12,5 @@ min: number; | ||
id?: string; | ||
colorTables: colorTablesArray; | ||
}; | ||
export declare const ContinuousLegend: React.FC<continuousLegendProps>; | ||
export {}; |
@@ -44,5 +44,4 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
import { range } from "d3"; | ||
import colorTables from "../color-tables.json"; | ||
export var ContinuousLegend = function (_a) { | ||
var min = _a.min, max = _a.max, dataObjectName = _a.dataObjectName, position = _a.position, colorName = _a.colorName, horizontal = _a.horizontal, updateLegend = _a.updateLegend, id = _a.id; | ||
var min = _a.min, max = _a.max, dataObjectName = _a.dataObjectName, position = _a.position, colorName = _a.colorName, horizontal = _a.horizontal, updateLegend = _a.updateLegend, id = _a.id, colorTables = _a.colorTables; | ||
var generateUniqueId = Math.ceil((Math.random() * 9999)).toString(); | ||
@@ -49,0 +48,0 @@ var divRef = useRef(null); |
import * as React from "react"; | ||
import { colorTablesArray } from "../colorTableTypes"; | ||
declare type discreteLegendProps = { | ||
@@ -12,2 +13,3 @@ discreteData: { | ||
id?: string; | ||
colorTables: colorTablesArray | string; | ||
}; | ||
@@ -14,0 +16,0 @@ export declare const DiscreteColorLegend: React.FC<discreteLegendProps>; |
@@ -43,5 +43,4 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
import { d3ColorScales } from "../Utils/d3ColorScale"; | ||
import colorTables from "../color-tables.json"; | ||
export var DiscreteColorLegend = function (_a) { | ||
var discreteData = _a.discreteData, dataObjectName = _a.dataObjectName, position = _a.position, colorName = _a.colorName, horizontal = _a.horizontal, updateLegend = _a.updateLegend, id = _a.id; | ||
var discreteData = _a.discreteData, dataObjectName = _a.dataObjectName, position = _a.position, colorName = _a.colorName, horizontal = _a.horizontal, updateLegend = _a.updateLegend, id = _a.id, colorTables = _a.colorTables; | ||
var generateUniqueId = Math.ceil((Math.random() * 9999)).toString(); | ||
@@ -48,0 +47,0 @@ var divRef = useRef(null); |
{ | ||
"name": "@emerson-eps/color-tables", | ||
"version": "0.2.34", | ||
"version": "0.2.35", | ||
"description": "Standard library of color tables for geological domain", | ||
@@ -5,0 +5,0 @@ "release": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
115813
1553