Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@forter/chart

Package Overview
Dependencies
Maintainers
3
Versions
133
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@forter/chart - npm Package Compare versions

Comparing version 5.41.0 to 5.41.1

11

CHANGELOG.md

@@ -6,2 +6,13 @@ # Change Log

## [5.41.1](https://github.com/forter/web-components/compare/@forter/chart@5.41.0...@forter/chart@5.41.1) (2024-06-19)
### Bug Fixes
* **chart:** doughnut legend and colors ([1ae0046](https://github.com/forter/web-components/commit/1ae0046))
# [5.41.0](https://github.com/forter/web-components/compare/@forter/chart@5.40.0...@forter/chart@5.41.0) (2024-06-09)

@@ -8,0 +19,0 @@

16

chart-config-builders/dataset-color-config-builder.js

@@ -171,18 +171,2 @@ import { get } from 'lodash-es';

dataset.borderColor = dataset.borderColor ? dataset.borderColor : (predefinedColors === null || predefinedColors === void 0 ? void 0 : predefinedColors.length) > 0 ? predefinedColors : DEFAULT_COLORS;
} else if (xAxisType === 'SIMPLE_KPI') {
const seriesStyles = config.series.map(ser => ({
label: ser.label,
style: ser.style
}));
const colors = dataset.data.map((dataPoint, index) => {
var _seriesStyles$find;
const {
aggregationLabel
} = dataPoint;
const dataPointStyle = (_seriesStyles$find = seriesStyles.find(ser => ser.label === aggregationLabel.trim())) === null || _seriesStyles$find === void 0 ? void 0 : _seriesStyles$find.style;
return (dataPointStyle === null || dataPointStyle === void 0 ? void 0 : dataPointStyle.backgroundColor) || DEFAULT_COLORS[index];
});
dataset.backgroundColor = colors;
dataset.borderColor = colors;
} else {

@@ -189,0 +173,0 @@ // in this case the datasets are per different dimension values

4

chart-config-builders/html-legend-builder.js
import { merge } from 'lodash-es';
import { CHART_TYPES, X_AXIS_TYPE } from '../enums.js';
import { CHART_TYPES } from '../enums.js';
import { dashedLegend } from './html-legend-striped.svg.js';

@@ -188,3 +188,3 @@

if ((chartJSConfig === null || chartJSConfig === void 0 ? void 0 : (_chartJSConfig$data = chartJSConfig.data) === null || _chartJSConfig$data === void 0 ? void 0 : _chartJSConfig$data.datasets[0].type) === CHART_TYPES.TREEMAP || (chartJSConfig === null || chartJSConfig === void 0 ? void 0 : chartJSConfig.type) === CHART_TYPES.SANKEY || (chartJSConfig === null || chartJSConfig === void 0 ? void 0 : chartJSConfig.type) === CHART_TYPES.FUNNEL || (config === null || config === void 0 ? void 0 : config.series[0].seriesType) === CHART_TYPES.HORIZONTAL_BAR || (config === null || config === void 0 ? void 0 : config.xAxisType) === X_AXIS_TYPE.SIMPLE_KPI) {
if ((chartJSConfig === null || chartJSConfig === void 0 ? void 0 : (_chartJSConfig$data = chartJSConfig.data) === null || _chartJSConfig$data === void 0 ? void 0 : _chartJSConfig$data.datasets[0].type) === CHART_TYPES.TREEMAP || (chartJSConfig === null || chartJSConfig === void 0 ? void 0 : chartJSConfig.type) === CHART_TYPES.SANKEY || (chartJSConfig === null || chartJSConfig === void 0 ? void 0 : chartJSConfig.type) === CHART_TYPES.FUNNEL || (config === null || config === void 0 ? void 0 : config.series[0].seriesType) === CHART_TYPES.HORIZONTAL_BAR) {
context.shadowRoot.getElementById('legend-container').style.display = 'none';

@@ -191,0 +191,0 @@ }

{
"name": "@forter/chart",
"version": "5.41.0",
"version": "5.41.1",
"description": "chart from Forter Components",

@@ -61,3 +61,3 @@ "author": "Forter Developers",

},
"gitHead": "97c39cb875326266a29059fb22e789869c6f62de"
"gitHead": "c7ad0432985ca73065dfd2fc0cecd1383588e732"
}

@@ -146,11 +146,2 @@ /* eslint-disable max-len */

dataset.borderColor = dataset.borderColor ? dataset.borderColor : (predefinedColors?.length > 0 ? predefinedColors : DEFAULT_COLORS);
} else if (xAxisType === 'SIMPLE_KPI') {
const seriesStyles = config.series.map(ser => ({ label: ser.label, style: ser.style }));
const colors = dataset.data.map((dataPoint, index) => {
const { aggregationLabel } = dataPoint;
const dataPointStyle = seriesStyles.find(ser => ser.label === aggregationLabel.trim())?.style;
return dataPointStyle?.backgroundColor || DEFAULT_COLORS[index];
});
dataset.backgroundColor = colors;
dataset.borderColor = colors;
} else {

@@ -157,0 +148,0 @@ // in this case the datasets are per different dimension values

import { merge } from 'lodash-es';
import { CHART_TYPES, X_AXIS_TYPE } from '../enums';
import { CHART_TYPES } from '../enums';
import { dashedLegend } from './html-legend-striped.svg';

@@ -170,4 +170,3 @@

chartJSConfig?.type === CHART_TYPES.FUNNEL ||
config?.series[0].seriesType === CHART_TYPES.HORIZONTAL_BAR ||
config?.xAxisType === X_AXIS_TYPE.SIMPLE_KPI
config?.series[0].seriesType === CHART_TYPES.HORIZONTAL_BAR
) {

@@ -174,0 +173,0 @@ context.shadowRoot.getElementById('legend-container').style.display = 'none';

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc