@nebula.js/sn-histogram 1.2.0 → 1.3.0
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.
- package/api-specifications/properties.json +1 -1
- package/core/esm/index.js +33 -13
- package/core/esm/index.js.map +1 -1
- package/dist/sn-histogram.js +33 -13
- package/dist/sn-histogram.js.map +1 -1
- package/dist/sn-histogram.systemjs.js +33 -13
- package/dist/sn-histogram.systemjs.js.map +1 -1
- package/package.json +2 -1
- package/sn-histogram-ext/dist/sn-histogram.js +33 -13
- package/sn-histogram-ext/sn-histogram.qext +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nebula.js/sn-histogram",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"description": "Histogram supernova",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"histogram",
|
|
@@ -49,6 +49,7 @@
|
|
|
49
49
|
"build:dev": "cross-env NODE_ENV=development nebula build --config ../../nebula.config.js",
|
|
50
50
|
"lint": "oxlint -c ../../oxlint.config.js src",
|
|
51
51
|
"start": "nebula serve --type histogram --config ../../nebula.config.js",
|
|
52
|
+
"start:mfe": "nebula serve --type histogram --config ../../nebula.config.js --mfe",
|
|
52
53
|
"sense": "nebula sense --partial",
|
|
53
54
|
"sense:watch": "node ../../scripts/sense-watch",
|
|
54
55
|
"spec": "sy from-jsdoc -c ./spec-configs/props.conf.js",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* @nebula.js/sn-histogram v1.
|
|
2
|
+
* @nebula.js/sn-histogram v1.3.0
|
|
3
3
|
* Copyright (c) 2026 QlikTech International AB
|
|
4
4
|
* Released under the MIT license.
|
|
5
5
|
*/
|
|
@@ -23258,7 +23258,7 @@
|
|
|
23258
23258
|
* @default
|
|
23259
23259
|
*/
|
|
23260
23260
|
// oxlint-disable-next-line no-undef
|
|
23261
|
-
version: "1.
|
|
23261
|
+
version: "1.3.0",
|
|
23262
23262
|
/**
|
|
23263
23263
|
* Extends `HyperCubeDef`, see Engine API: `HyperCubeDef`.
|
|
23264
23264
|
* @extends {HyperCubeDef}
|
|
@@ -23491,6 +23491,26 @@
|
|
|
23491
23491
|
footnote: ""
|
|
23492
23492
|
};
|
|
23493
23493
|
|
|
23494
|
+
const FALLBACK_INDEX = 6;
|
|
23495
|
+
|
|
23496
|
+
/**
|
|
23497
|
+
* Index of the theme's primary color in the first color picker palette.
|
|
23498
|
+
* Custom themes may not put the primary color at a fixed position, so it is looked up.
|
|
23499
|
+
* The theme is not always available when the chart is created (e.g. qlik-embed), then the old default applies.
|
|
23500
|
+
*/
|
|
23501
|
+
function getDefaultBarColor(theme) {
|
|
23502
|
+
const palette = theme?.getDataColorPickerPalettes()?.[0]?.colors;
|
|
23503
|
+
if (!palette?.length) {
|
|
23504
|
+
return {
|
|
23505
|
+
index: FALLBACK_INDEX
|
|
23506
|
+
};
|
|
23507
|
+
}
|
|
23508
|
+
const index = palette.indexOf(theme.getDataColorSpecials().primary);
|
|
23509
|
+
return {
|
|
23510
|
+
index: index === -1 ? Math.min(FALLBACK_INDEX, palette.length - 1) : index
|
|
23511
|
+
};
|
|
23512
|
+
}
|
|
23513
|
+
|
|
23494
23514
|
function data(env) {
|
|
23495
23515
|
const {
|
|
23496
23516
|
translator
|
|
@@ -34531,16 +34551,7 @@
|
|
|
34531
34551
|
}
|
|
34532
34552
|
};
|
|
34533
34553
|
const theme = env.theme;
|
|
34534
|
-
const defaultColor = () =>
|
|
34535
|
-
const {
|
|
34536
|
-
primary
|
|
34537
|
-
} = theme.getDataColorSpecials();
|
|
34538
|
-
const palette = theme.getDataColorPickerPalettes()[0].colors;
|
|
34539
|
-
const index = palette.indexOf(primary);
|
|
34540
|
-
return {
|
|
34541
|
-
index: index === -1 ? Math.min(6, palette.length - 1) : index
|
|
34542
|
-
};
|
|
34543
|
-
};
|
|
34554
|
+
const defaultColor = () => getDefaultBarColor(theme);
|
|
34544
34555
|
const colors = {
|
|
34545
34556
|
translation: "properties.colors",
|
|
34546
34557
|
type: "items",
|
|
@@ -34990,7 +35001,16 @@
|
|
|
34990
35001
|
const dataDefinition = data(env);
|
|
34991
35002
|
return {
|
|
34992
35003
|
qae: {
|
|
34993
|
-
properties
|
|
35004
|
+
properties: {
|
|
35005
|
+
...properties,
|
|
35006
|
+
color: {
|
|
35007
|
+
...properties.color,
|
|
35008
|
+
bar: {
|
|
35009
|
+
...properties.color?.bar,
|
|
35010
|
+
paletteColor: getDefaultBarColor(env.theme)
|
|
35011
|
+
}
|
|
35012
|
+
}
|
|
35013
|
+
},
|
|
34994
35014
|
data: {
|
|
34995
35015
|
targets: [dataDefinition]
|
|
34996
35016
|
},
|