shap-svg 0.2.0 → 0.2.2
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/README.md +39 -0
- package/dist/{chunk-OXFKP5I3.js → chunk-4X6PMJYT.js} +235 -34
- package/dist/chunk-4X6PMJYT.js.map +1 -0
- package/dist/index.cjs +240 -33
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +104 -7
- package/dist/index.d.ts +104 -7
- package/dist/index.js +13 -1
- package/dist/{format-wEav_cPe.d.cts → labels-7wofev8M.d.cts} +44 -1
- package/dist/{format-wEav_cPe.d.ts → labels-7wofev8M.d.ts} +44 -1
- package/dist/react.cjs +369 -126
- package/dist/react.cjs.map +1 -1
- package/dist/react.d.cts +33 -5
- package/dist/react.d.ts +33 -5
- package/dist/react.js +143 -92
- package/dist/react.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-OXFKP5I3.js.map +0 -1
package/dist/react.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
|
-
import { E as Explanation, R as RowSort, V as ValuePrecision } from './
|
|
2
|
+
import { E as Explanation, a as PlotLabels, R as RowSort, V as ValuePrecision } from './labels-7wofev8M.cjs';
|
|
3
3
|
|
|
4
4
|
type ShapBarProps = {
|
|
5
5
|
explanation: Explanation;
|
|
@@ -10,9 +10,15 @@ type ShapBarProps = {
|
|
|
10
10
|
classIndex?: number;
|
|
11
11
|
width?: number;
|
|
12
12
|
rowHeight?: number;
|
|
13
|
+
/**
|
|
14
|
+
* Wording for every piece of text the chart draws; keys not given keep SHAP's.
|
|
15
|
+
* Pass a stable object (a module constant or a memo): a new one each render
|
|
16
|
+
* recomputes the layout each render.
|
|
17
|
+
*/
|
|
18
|
+
labels?: Partial<PlotLabels>;
|
|
13
19
|
onFeatureClick?: (featureIndex: number | null) => void;
|
|
14
20
|
};
|
|
15
|
-
declare function ShapBar({ explanation, maxDisplay, faithfulOtherRow, groupByGenus, classIndex, width, rowHeight, onFeatureClick, }: ShapBarProps): react.JSX.Element;
|
|
21
|
+
declare function ShapBar({ explanation, maxDisplay, faithfulOtherRow, groupByGenus, classIndex, width, rowHeight, labels, onFeatureClick, }: ShapBarProps): react.JSX.Element;
|
|
16
22
|
|
|
17
23
|
type ShapBeeswarmProps = {
|
|
18
24
|
explanation: Explanation;
|
|
@@ -27,9 +33,17 @@ type ShapBeeswarmProps = {
|
|
|
27
33
|
rowHeight?: number;
|
|
28
34
|
seed?: number;
|
|
29
35
|
dotRadius?: number;
|
|
36
|
+
/** SHAP's Low–High feature value colour bar, as color_bar=True draws it. */
|
|
37
|
+
colorBar?: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Wording for every piece of text the chart draws; keys not given keep SHAP's.
|
|
40
|
+
* Pass a stable object (a module constant or a memo): a new one each render
|
|
41
|
+
* recomputes the layout each render.
|
|
42
|
+
*/
|
|
43
|
+
labels?: Partial<PlotLabels>;
|
|
30
44
|
onFeatureClick?: (featureIndex: number | null) => void;
|
|
31
45
|
};
|
|
32
|
-
declare function ShapBeeswarm({ explanation, maxDisplay, faithfulOtherRow, groupByGenus, rowSort, classIndex, width, rowHeight, seed, dotRadius, onFeatureClick, }: ShapBeeswarmProps): react.JSX.Element;
|
|
46
|
+
declare function ShapBeeswarm({ explanation, maxDisplay, faithfulOtherRow, groupByGenus, rowSort, classIndex, width, rowHeight, seed, dotRadius, colorBar, labels, onFeatureClick, }: ShapBeeswarmProps): react.JSX.Element;
|
|
33
47
|
|
|
34
48
|
type ShapHeatmapProps = {
|
|
35
49
|
explanation: Explanation;
|
|
@@ -42,10 +56,18 @@ type ShapHeatmapProps = {
|
|
|
42
56
|
classIndex?: number;
|
|
43
57
|
width?: number;
|
|
44
58
|
rowHeight?: number;
|
|
59
|
+
/** SHAP's colour bar for the SHAP value range, as _heatmap.py always draws it. */
|
|
60
|
+
colorBar?: boolean;
|
|
61
|
+
/**
|
|
62
|
+
* Wording for every piece of text the chart draws; keys not given keep SHAP's.
|
|
63
|
+
* Pass a stable object (a module constant or a memo): a new one each render
|
|
64
|
+
* recomputes the layout each render.
|
|
65
|
+
*/
|
|
66
|
+
labels?: Partial<PlotLabels>;
|
|
45
67
|
onFeatureClick?: (featureIndex: number | null) => void;
|
|
46
68
|
onSampleClick?: (sampleId: string) => void;
|
|
47
69
|
};
|
|
48
|
-
declare function ShapHeatmap({ explanation, maxDisplay, faithfulOtherRow, groupByGenus, rowSort, classIndex, width, rowHeight, onFeatureClick, onSampleClick, }: ShapHeatmapProps): react.JSX.Element;
|
|
70
|
+
declare function ShapHeatmap({ explanation, maxDisplay, faithfulOtherRow, groupByGenus, rowSort, classIndex, width, rowHeight, colorBar, labels, onFeatureClick, onSampleClick, }: ShapHeatmapProps): react.JSX.Element;
|
|
49
71
|
|
|
50
72
|
type ShapWaterfallProps = {
|
|
51
73
|
explanation: Explanation;
|
|
@@ -59,9 +81,15 @@ type ShapWaterfallProps = {
|
|
|
59
81
|
rowHeight?: number;
|
|
60
82
|
/** Decimal places for the bar labels. Display only — it changes no geometry but the text width. */
|
|
61
83
|
decimals?: ValuePrecision;
|
|
84
|
+
/**
|
|
85
|
+
* Wording for every piece of text the chart draws; keys not given keep SHAP's.
|
|
86
|
+
* Pass a stable object (a module constant or a memo): a new one each render
|
|
87
|
+
* recomputes the layout each render.
|
|
88
|
+
*/
|
|
89
|
+
labels?: Partial<PlotLabels>;
|
|
62
90
|
onFeatureClick?: (featureIndex: number | null) => void;
|
|
63
91
|
};
|
|
64
|
-
declare function ShapWaterfall({ explanation, sampleIndex, maxDisplay, faithfulOtherRow, groupByGenus, classIndex, width, rowHeight, decimals, onFeatureClick, }: ShapWaterfallProps): react.JSX.Element;
|
|
92
|
+
declare function ShapWaterfall({ explanation, sampleIndex, maxDisplay, faithfulOtherRow, groupByGenus, classIndex, width, rowHeight, decimals, labels, onFeatureClick, }: ShapWaterfallProps): react.JSX.Element;
|
|
65
93
|
|
|
66
94
|
/**
|
|
67
95
|
* The four charts, named the way shap names them in Python: `shap.plots.bar`
|
package/dist/react.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
|
-
import { E as Explanation, R as RowSort, V as ValuePrecision } from './
|
|
2
|
+
import { E as Explanation, a as PlotLabels, R as RowSort, V as ValuePrecision } from './labels-7wofev8M.js';
|
|
3
3
|
|
|
4
4
|
type ShapBarProps = {
|
|
5
5
|
explanation: Explanation;
|
|
@@ -10,9 +10,15 @@ type ShapBarProps = {
|
|
|
10
10
|
classIndex?: number;
|
|
11
11
|
width?: number;
|
|
12
12
|
rowHeight?: number;
|
|
13
|
+
/**
|
|
14
|
+
* Wording for every piece of text the chart draws; keys not given keep SHAP's.
|
|
15
|
+
* Pass a stable object (a module constant or a memo): a new one each render
|
|
16
|
+
* recomputes the layout each render.
|
|
17
|
+
*/
|
|
18
|
+
labels?: Partial<PlotLabels>;
|
|
13
19
|
onFeatureClick?: (featureIndex: number | null) => void;
|
|
14
20
|
};
|
|
15
|
-
declare function ShapBar({ explanation, maxDisplay, faithfulOtherRow, groupByGenus, classIndex, width, rowHeight, onFeatureClick, }: ShapBarProps): react.JSX.Element;
|
|
21
|
+
declare function ShapBar({ explanation, maxDisplay, faithfulOtherRow, groupByGenus, classIndex, width, rowHeight, labels, onFeatureClick, }: ShapBarProps): react.JSX.Element;
|
|
16
22
|
|
|
17
23
|
type ShapBeeswarmProps = {
|
|
18
24
|
explanation: Explanation;
|
|
@@ -27,9 +33,17 @@ type ShapBeeswarmProps = {
|
|
|
27
33
|
rowHeight?: number;
|
|
28
34
|
seed?: number;
|
|
29
35
|
dotRadius?: number;
|
|
36
|
+
/** SHAP's Low–High feature value colour bar, as color_bar=True draws it. */
|
|
37
|
+
colorBar?: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Wording for every piece of text the chart draws; keys not given keep SHAP's.
|
|
40
|
+
* Pass a stable object (a module constant or a memo): a new one each render
|
|
41
|
+
* recomputes the layout each render.
|
|
42
|
+
*/
|
|
43
|
+
labels?: Partial<PlotLabels>;
|
|
30
44
|
onFeatureClick?: (featureIndex: number | null) => void;
|
|
31
45
|
};
|
|
32
|
-
declare function ShapBeeswarm({ explanation, maxDisplay, faithfulOtherRow, groupByGenus, rowSort, classIndex, width, rowHeight, seed, dotRadius, onFeatureClick, }: ShapBeeswarmProps): react.JSX.Element;
|
|
46
|
+
declare function ShapBeeswarm({ explanation, maxDisplay, faithfulOtherRow, groupByGenus, rowSort, classIndex, width, rowHeight, seed, dotRadius, colorBar, labels, onFeatureClick, }: ShapBeeswarmProps): react.JSX.Element;
|
|
33
47
|
|
|
34
48
|
type ShapHeatmapProps = {
|
|
35
49
|
explanation: Explanation;
|
|
@@ -42,10 +56,18 @@ type ShapHeatmapProps = {
|
|
|
42
56
|
classIndex?: number;
|
|
43
57
|
width?: number;
|
|
44
58
|
rowHeight?: number;
|
|
59
|
+
/** SHAP's colour bar for the SHAP value range, as _heatmap.py always draws it. */
|
|
60
|
+
colorBar?: boolean;
|
|
61
|
+
/**
|
|
62
|
+
* Wording for every piece of text the chart draws; keys not given keep SHAP's.
|
|
63
|
+
* Pass a stable object (a module constant or a memo): a new one each render
|
|
64
|
+
* recomputes the layout each render.
|
|
65
|
+
*/
|
|
66
|
+
labels?: Partial<PlotLabels>;
|
|
45
67
|
onFeatureClick?: (featureIndex: number | null) => void;
|
|
46
68
|
onSampleClick?: (sampleId: string) => void;
|
|
47
69
|
};
|
|
48
|
-
declare function ShapHeatmap({ explanation, maxDisplay, faithfulOtherRow, groupByGenus, rowSort, classIndex, width, rowHeight, onFeatureClick, onSampleClick, }: ShapHeatmapProps): react.JSX.Element;
|
|
70
|
+
declare function ShapHeatmap({ explanation, maxDisplay, faithfulOtherRow, groupByGenus, rowSort, classIndex, width, rowHeight, colorBar, labels, onFeatureClick, onSampleClick, }: ShapHeatmapProps): react.JSX.Element;
|
|
49
71
|
|
|
50
72
|
type ShapWaterfallProps = {
|
|
51
73
|
explanation: Explanation;
|
|
@@ -59,9 +81,15 @@ type ShapWaterfallProps = {
|
|
|
59
81
|
rowHeight?: number;
|
|
60
82
|
/** Decimal places for the bar labels. Display only — it changes no geometry but the text width. */
|
|
61
83
|
decimals?: ValuePrecision;
|
|
84
|
+
/**
|
|
85
|
+
* Wording for every piece of text the chart draws; keys not given keep SHAP's.
|
|
86
|
+
* Pass a stable object (a module constant or a memo): a new one each render
|
|
87
|
+
* recomputes the layout each render.
|
|
88
|
+
*/
|
|
89
|
+
labels?: Partial<PlotLabels>;
|
|
62
90
|
onFeatureClick?: (featureIndex: number | null) => void;
|
|
63
91
|
};
|
|
64
|
-
declare function ShapWaterfall({ explanation, sampleIndex, maxDisplay, faithfulOtherRow, groupByGenus, classIndex, width, rowHeight, decimals, onFeatureClick, }: ShapWaterfallProps): react.JSX.Element;
|
|
92
|
+
declare function ShapWaterfall({ explanation, sampleIndex, maxDisplay, faithfulOtherRow, groupByGenus, classIndex, width, rowHeight, decimals, labels, onFeatureClick, }: ShapWaterfallProps): react.JSX.Element;
|
|
65
93
|
|
|
66
94
|
/**
|
|
67
95
|
* The four charts, named the way shap names them in Python: `shap.plots.bar`
|