shap-svg 0.1.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.
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/react/ShapBar.tsx","../src/react/XAxis.tsx","../src/react/ShapWaterfall.tsx","../src/react/ShapBeeswarm.tsx","../src/react/ShapHeatmap.tsx"],"sourcesContent":["import { useMemo, useState } from \"react\";\nimport { Explanation } from \"../core/types\";\nimport { parseExplanation } from \"../core/parse\";\nimport { groupExplanationByGenus } from \"../core/taxonomy\";\nimport { globalImportance, orderFeatures } from \"../core/order\";\nimport { collapseToDisplay } from \"../core/collapse\";\nimport { barLayout } from \"../core/barLayout\";\nimport { formatShapValue } from \"../core/format\";\nimport { XAxis } from \"./XAxis\";\n\nexport type ShapBarProps = {\n explanation: Explanation;\n maxDisplay?: number;\n faithfulOtherRow?: boolean;\n /** Collapse `Genus_species` Features into their genus before drawing. */\n groupByGenus?: boolean;\n classIndex?: number;\n width?: number;\n rowHeight?: number;\n onFeatureClick?: (featureIndex: number | null) => void;\n};\n\nexport function ShapBar({\n explanation,\n maxDisplay = 10,\n faithfulOtherRow = false,\n groupByGenus = false,\n classIndex = 1,\n width = 720,\n rowHeight = 26,\n onFeatureClick,\n}: ShapBarProps) {\n const [hovered, setHovered] = useState<number | null>(null);\n\n const layout = useMemo(() => {\n const raw = parseExplanation(explanation, { classIndex });\n const parsed = groupByGenus ? groupExplanationByGenus(raw) : raw;\n const importance = globalImportance(parsed);\n const order = orderFeatures(importance);\n const rows = collapseToDisplay(\n parsed.featureNames, importance, order, maxDisplay, faithfulOtherRow,\n );\n return barLayout(rows, {\n width, rowHeight, marginLeft: 260, marginRight: 90, marginTop: 8,\n });\n }, [groupByGenus, explanation, maxDisplay, faithfulOtherRow, classIndex, width, rowHeight]);\n\n return (\n <svg width={width} height={layout.height} role=\"img\"\n aria-label=\"Mean absolute SHAP value per feature\">\n <line x1={layout.zeroLine.x} x2={layout.zeroLine.x}\n y1={layout.zeroLine.y1} y2={layout.zeroLine.y2}\n stroke=\"#333333\" strokeWidth={1} />\n <XAxis ticks={layout.xTicks} spine={layout.xSpine} title={layout.xTitle}\n plotBottom={layout.plotBottom} tickFontSize={11} />\n {layout.bars.map((bar, i) => (\n <g key={`row-${i}`}\n onMouseEnter={() => setHovered(i)}\n onMouseLeave={() => setHovered(null)}\n onClick={() => onFeatureClick?.(bar.featureIndex)}\n style={{ cursor: onFeatureClick ? \"pointer\" : \"default\" }}>\n <rect x={0} y={bar.y - (rowHeight - bar.height) / 2}\n width={width} height={rowHeight}\n fill={hovered === i ? \"#00000008\" : \"transparent\"} />\n <text x={250} y={bar.centerY} textAnchor=\"end\" dominantBaseline=\"middle\"\n fontSize={13} fill=\"#333333\"\n fontStyle={bar.isOtherRow ? \"normal\" : \"italic\"}>\n {bar.label}\n </text>\n <rect x={bar.x} y={bar.y} width={bar.width} height={bar.height}\n fill={bar.color} stroke=\"rgba(255,255,255,0.8)\" strokeWidth={1} />\n <text x={bar.x + bar.width + 6} y={bar.centerY} dominantBaseline=\"middle\"\n fontSize={12} fill={bar.color}>\n {formatShapValue(bar.value)}\n </text>\n </g>\n ))}\n </svg>\n );\n}\n","import {\n AxisSpine,\n AxisTick,\n AxisTitle,\n TICK_LABEL_DY,\n TICK_LENGTH,\n} from \"../core/ticks\";\n\n/**\n * The bottom axis the summary charts share: optional spine, outward ticks with\n * labels, and a centred title. The layouts decide every position; this only\n * draws them, so the three charts cannot drift apart in how an axis looks.\n */\nexport function XAxis({\n ticks,\n spine,\n title,\n plotBottom,\n tickFontSize = 11,\n}: {\n ticks: AxisTick[];\n spine: AxisSpine | null;\n title: AxisTitle;\n plotBottom: number;\n /** SHAP's tick label size for the chart, in the same units as the text. */\n tickFontSize?: number;\n}) {\n return (\n <g aria-hidden=\"true\">\n {spine && (\n <line\n x1={spine.x1}\n x2={spine.x2}\n y1={spine.y}\n y2={spine.y}\n stroke=\"#333333\"\n strokeWidth={1}\n />\n )}\n {ticks.map((tick) => (\n <g key={`xtick-${tick.value}`}>\n <line\n x1={tick.x}\n x2={tick.x}\n y1={plotBottom}\n y2={plotBottom + TICK_LENGTH}\n stroke=\"#333333\"\n strokeWidth={1}\n />\n <text\n x={tick.x}\n y={plotBottom + TICK_LABEL_DY}\n textAnchor=\"middle\"\n fontSize={tickFontSize}\n fill=\"#333333\"\n >\n {tick.label}\n </text>\n </g>\n ))}\n <text\n x={title.x}\n y={title.y}\n textAnchor=\"middle\"\n fontSize={title.fontSize}\n fill=\"#333333\"\n >\n {title.text}\n </text>\n </g>\n );\n}\n","import { useMemo, useState } from \"react\";\nimport { Explanation } from \"../core/types\";\nimport { parseExplanation } from \"../core/parse\";\nimport { groupExplanationByGenus } from \"../core/taxonomy\";\nimport { ValuePrecision } from \"../core/format\";\nimport {\n WATERFALL_BASE_LABEL_DY,\n WATERFALL_TICK_LABEL_DY,\n waterfallLayout,\n waterfallRows,\n} from \"../core/waterfallLayout\";\n\nexport type ShapWaterfallProps = {\n explanation: Explanation;\n sampleIndex?: number;\n maxDisplay?: number;\n faithfulOtherRow?: boolean;\n /** Collapse `Genus_species` Features into their genus before drawing. */\n groupByGenus?: boolean;\n classIndex?: number;\n width?: number;\n rowHeight?: number;\n /** Decimal places for the bar labels. Display only — it changes no geometry but the text width. */\n decimals?: ValuePrecision;\n onFeatureClick?: (featureIndex: number | null) => void;\n};\n\nexport function ShapWaterfall({\n explanation,\n sampleIndex = 0,\n maxDisplay = 10,\n faithfulOtherRow = false,\n groupByGenus = false,\n classIndex = 1,\n width = 720,\n rowHeight = 30,\n decimals = 2,\n onFeatureClick,\n}: ShapWaterfallProps) {\n const [hovered, setHovered] = useState<number | null>(null);\n const marginTop = 34;\n\n const layout = useMemo(() => {\n const raw = parseExplanation(explanation, { classIndex });\n const parsed = groupByGenus ? groupExplanationByGenus(raw) : raw;\n const rows = waterfallRows(parsed, sampleIndex, maxDisplay, faithfulOtherRow);\n return waterfallLayout(rows, {\n width,\n rowHeight,\n marginLeft: 260,\n marginRight: 110,\n marginTop,\n decimals,\n });\n }, [groupByGenus, \n explanation, sampleIndex, maxDisplay, faithfulOtherRow,\n classIndex, width, rowHeight, decimals,\n ]);\n\n return (\n <svg\n width={width}\n height={layout.height}\n role=\"img\"\n aria-label={`Local SHAP waterfall for Sample ${sampleIndex}`}\n >\n {layout.separators.map((separator, index) => (\n <line\n key={`separator-${index}`}\n x1={separator.x1}\n x2={separator.x2}\n y1={separator.y}\n y2={separator.y}\n stroke=\"#cccccc\"\n strokeWidth={1}\n strokeDasharray=\"1 5\"\n />\n ))}\n\n <g aria-hidden=\"true\">\n <line\n x1={layout.plotLeft}\n x2={layout.plotRight}\n y1={layout.plotBottom}\n y2={layout.plotBottom}\n stroke=\"#333333\"\n strokeWidth={1}\n />\n {layout.xTicks.map((tick) => (\n <g key={`tick-${tick.value}`}>\n <line\n x1={tick.x}\n x2={tick.x}\n y1={layout.plotBottom}\n y2={layout.plotBottom + 5}\n stroke=\"#333333\"\n strokeWidth={1}\n />\n <text\n x={tick.x}\n y={layout.plotBottom + WATERFALL_TICK_LABEL_DY}\n textAnchor=\"middle\"\n fontSize={11}\n fill=\"#333333\"\n >\n {tick.label}\n </text>\n </g>\n ))}\n </g>\n\n {layout.connectors.map((connector, index) => (\n <line\n key={`connector-${index}`}\n x1={connector.x}\n x2={connector.x}\n y1={connector.y1}\n y2={connector.y2}\n stroke=\"#bbbbbb\"\n strokeWidth={1}\n strokeDasharray=\"4 4\"\n />\n ))}\n\n {layout.axisMarks.map((mark) => (\n <g key={mark.kind}>\n <line\n x1={mark.x}\n x2={mark.x}\n y1={mark.y1}\n y2={mark.y2}\n stroke=\"#bbbbbb\"\n strokeWidth={1}\n strokeDasharray=\"4 4\"\n />\n <text\n x={mark.x}\n y={\n mark.kind === \"output\"\n ? marginTop - 10\n : layout.plotBottom + WATERFALL_BASE_LABEL_DY\n }\n textAnchor=\"middle\"\n fontSize={12}\n fill=\"#777777\"\n >\n {mark.label}\n </text>\n </g>\n ))}\n\n {layout.arrows.map((arrow, index) => (\n <g\n key={`row-${index}`}\n onMouseEnter={() => setHovered(index)}\n onMouseLeave={() => setHovered(null)}\n onClick={() => onFeatureClick?.(arrow.featureIndex)}\n style={{ cursor: onFeatureClick ? \"pointer\" : \"default\" }}\n >\n <rect\n x={0}\n y={arrow.centerY - rowHeight / 2}\n width={width}\n height={rowHeight}\n fill={hovered === index ? \"#00000008\" : \"transparent\"}\n />\n <text\n x={250}\n y={arrow.centerY}\n textAnchor=\"end\"\n dominantBaseline=\"middle\"\n fontSize={13}\n fill=\"#333333\"\n fontStyle={arrow.isOtherRow ? \"normal\" : \"italic\"}\n >\n {arrow.label}\n </text>\n <polygon\n points={arrow.points.map((point) => `${point.x},${point.y}`).join(\" \")}\n fill={arrow.color}\n stroke=\"rgba(255,255,255,0.8)\"\n strokeWidth={1}\n />\n <text\n x={arrow.valueLabel.x}\n y={arrow.centerY}\n textAnchor={arrow.valueLabel.anchor}\n dominantBaseline=\"middle\"\n fontSize={12}\n fill={arrow.valueLabel.inside ? \"#ffffff\" : arrow.color}\n >\n {arrow.valueLabel.text}\n </text>\n </g>\n ))}\n </svg>\n );\n}\n","import { MouseEvent as ReactMouseEvent, useMemo, useState } from \"react\";\nimport { beeswarmLayout, beeswarmRows } from \"../core/beeswarmLayout\";\nimport { sampleColormap } from \"../core/colormap\";\nimport { formatShapValue } from \"../core/format\";\nimport { XAxis } from \"./XAxis\";\nimport { parseExplanation } from \"../core/parse\";\nimport { groupExplanationByGenus } from \"../core/taxonomy\";\nimport { RowSort } from \"../core/rowSort\";\nimport { Explanation } from \"../core/types\";\n\nexport type ShapBeeswarmProps = {\n explanation: Explanation;\n maxDisplay?: number;\n faithfulOtherRow?: boolean;\n /** Collapse `Genus_species` Features into their genus before drawing. */\n groupByGenus?: boolean;\n /** Order of the displayed rows. Never changes which rows are shown. */\n rowSort?: RowSort;\n classIndex?: number;\n width?: number;\n rowHeight?: number;\n seed?: number;\n dotRadius?: number;\n onFeatureClick?: (featureIndex: number | null) => void;\n};\n\ntype HoveredPoint = { rowIndex: number; pointIndex: number };\n\nexport function ShapBeeswarm({\n explanation,\n maxDisplay = 10,\n faithfulOtherRow = false,\n groupByGenus = false,\n rowSort = \"importance\",\n classIndex = 1,\n width = 720,\n rowHeight = 28,\n seed = 0,\n dotRadius = 3,\n onFeatureClick,\n}: ShapBeeswarmProps) {\n const [hovered, setHovered] = useState<HoveredPoint | null>(null);\n const marginTop = 8;\n\n const layout = useMemo(() => {\n const raw = parseExplanation(explanation, { classIndex });\n const parsed = groupByGenus ? groupExplanationByGenus(raw) : raw;\n const rows = beeswarmRows(parsed, maxDisplay, faithfulOtherRow, seed, rowSort);\n return beeswarmLayout(rows, {\n width,\n rowHeight,\n marginLeft: 260,\n marginRight: 90,\n marginTop,\n dotRadius,\n });\n }, [groupByGenus, rowSort, \n explanation,\n maxDisplay,\n faithfulOtherRow,\n classIndex,\n width,\n rowHeight,\n seed,\n dotRadius,\n ]);\n\n const handlePointHover = (rowIndex: number, event: ReactMouseEvent<SVGGElement>) => {\n const attribute = (event.target as Element).getAttribute?.(\"data-point-index\");\n if (attribute === null || attribute === undefined) return;\n const pointIndex = Number(attribute);\n if (Number.isInteger(pointIndex)) setHovered({ rowIndex, pointIndex });\n };\n\n const fallbackRow = layout.rows[0];\n const activeRow = hovered ? layout.rows[hovered.rowIndex] : fallbackRow;\n const activePoint = hovered\n ? activeRow?.points[hovered.pointIndex]\n : activeRow?.points[0];\n const legendSteps = 32;\n\n return (\n <svg width={width} height={layout.height} role=\"img\" aria-label=\"Global SHAP beeswarm\">\n <line\n x1={layout.xZero}\n x2={layout.xZero}\n y1={marginTop}\n y2={layout.plotBottom}\n stroke=\"#777777\"\n strokeWidth={1}\n />\n\n {layout.rows.map((row, rowIndex) => (\n <g\n key={`row-${rowIndex}`}\n onMouseOver={(event) => handlePointHover(rowIndex, event)}\n onMouseLeave={() => setHovered(null)}\n onClick={() => onFeatureClick?.(row.featureIndex)}\n style={{ cursor: onFeatureClick ? \"pointer\" : \"default\" }}\n >\n <rect\n x={0}\n y={row.centerY - rowHeight / 2}\n width={width}\n height={rowHeight}\n fill={hovered?.rowIndex === rowIndex ? \"#00000008\" : \"transparent\"}\n />\n <text\n x={250}\n y={row.centerY}\n textAnchor=\"end\"\n dominantBaseline=\"middle\"\n fontSize={13}\n fill=\"#333333\"\n fontStyle={row.isOtherRow ? \"normal\" : \"italic\"}\n >\n {row.label}\n </text>\n {row.points.map((point, pointIndex) => (\n <circle\n key={`point-${point.sampleIndex}`}\n data-point-index={pointIndex}\n cx={point.x}\n cy={point.y}\n r={point.radius}\n fill={point.color}\n fillOpacity={0.7}\n />\n ))}\n </g>\n ))}\n\n <XAxis\n ticks={layout.xTicks}\n spine={layout.xSpine}\n title={layout.xTitle}\n plotBottom={layout.plotBottom}\n tickFontSize={11}\n />\n\n {activeRow && (\n <g aria-label=\"Feature value colour scale\">\n {Array.from({ length: legendSteps }, (_, index) => (\n <rect\n key={`legend-${index}`}\n x={width - 160 + index * 4}\n y={layout.height - 22}\n width={4}\n height={7}\n fill={sampleColormap(\"red_blue\", index / (legendSteps - 1))}\n />\n ))}\n <text x={width - 160} y={layout.height - 3} fontSize={10} fill=\"#555555\">\n {formatShapValue(activeRow.vmin)}\n </text>\n <text\n x={width - 32}\n y={layout.height - 3}\n textAnchor=\"end\"\n fontSize={10}\n fill=\"#555555\"\n >\n {formatShapValue(activeRow.vmax)}\n </text>\n </g>\n )}\n\n {activeRow && activePoint && (\n <g\n opacity={hovered ? 1 : 0}\n pointerEvents=\"none\"\n transform={`translate(${activePoint.x + 8} ${activePoint.y - 8})`}\n >\n <rect x={0} y={-16} width={210} height={54} rx={3} fill=\"#ffffff\" stroke=\"#cccccc\" />\n <text x={7} y={0} fontSize={11} fill=\"#222222\">{activeRow.label}</text>\n <text x={7} y={15} fontSize={11} fill=\"#222222\">\n {`SHAP value: ${formatShapValue(activePoint.valueX)}`}\n </text>\n <text x={7} y={30} fontSize={11} fill=\"#222222\">\n {`Feature value: ${Number.isFinite(activePoint.featureValue)\n ? formatShapValue(activePoint.featureValue)\n : \"missing\"}`}\n </text>\n </g>\n )}\n </svg>\n );\n}\n","import { useMemo, useState } from \"react\";\nimport { formatShapValue } from \"../core/format\";\nimport { XAxis } from \"./XAxis\";\nimport { heatmapLayout, heatmapRows } from \"../core/heatmapLayout\";\nimport { parseExplanation } from \"../core/parse\";\nimport { groupExplanationByGenus } from \"../core/taxonomy\";\nimport { RowSort } from \"../core/rowSort\";\nimport { Explanation } from \"../core/types\";\n\nexport type ShapHeatmapProps = {\n explanation: Explanation;\n maxDisplay?: number;\n faithfulOtherRow?: boolean;\n /** Collapse `Genus_species` Features into their genus before drawing. */\n groupByGenus?: boolean;\n /** Order of the displayed rows. Never changes which rows are shown. */\n rowSort?: RowSort;\n classIndex?: number;\n width?: number;\n rowHeight?: number;\n onFeatureClick?: (featureIndex: number | null) => void;\n onSampleClick?: (sampleId: string) => void;\n};\n\nexport function ShapHeatmap({\n explanation,\n maxDisplay = 10,\n faithfulOtherRow = false,\n groupByGenus = false,\n rowSort = \"importance\",\n classIndex = 1,\n width = 720,\n rowHeight = 26,\n onFeatureClick,\n onSampleClick,\n}: ShapHeatmapProps) {\n const [hoveredColumn, setHoveredColumn] = useState<number | null>(null);\n const marginTop = 72;\n\n const layout = useMemo(() => {\n const raw = parseExplanation(explanation, { classIndex });\n const parsed = groupByGenus ? groupExplanationByGenus(raw) : raw;\n const rows = heatmapRows(parsed, maxDisplay, faithfulOtherRow, rowSort);\n return heatmapLayout(rows, {\n width,\n rowHeight,\n marginLeft: 260,\n marginRight: 100,\n marginTop,\n });\n }, [groupByGenus, rowSort, explanation, maxDisplay, faithfulOtherRow, classIndex, width, rowHeight]);\n\n const activeColumn = hoveredColumn === null ? undefined : layout.columns[hoveredColumn];\n\n // What a person reads for a column. sampleId is the record UUID — the key\n // onSampleClick hands back — and is never shown: an old payload without\n // labels reads \"Sample n\" rather than a UUID.\n const nameOf = (column: { sampleIndex: number; sampleLabel?: string }) => {\n if (!column.sampleLabel) return `Sample ${column.sampleIndex + 1}`;\n return layout.sampleLabelColumn\n ? `${layout.sampleLabelColumn}: ${column.sampleLabel}`\n : column.sampleLabel;\n };\n // Real ids (\"subject_id: CCIS02856720ST-4-0\") run past a fixed box.\n const tooltipWidth = activeColumn\n ? Math.max(190, nameOf(activeColumn).length * 6.5 + 16)\n : 190;\n const tooltipX = activeColumn\n ? Math.max(0, Math.min(activeColumn.centerX + 8, width - tooltipWidth - 8))\n : 0;\n\n return (\n <svg width={width} height={layout.height} role=\"img\" aria-label=\"Global SHAP heatmap\">\n {layout.fxAxisMarks.map((mark) => (\n <g key={`fx-axis-${mark.value}`}>\n <line\n x1={layout.gridLeft - 4}\n x2={layout.gridRight}\n y1={mark.y}\n y2={mark.y}\n stroke=\"#dddddd\"\n strokeWidth={1}\n />\n <text\n x={layout.gridLeft - 8}\n y={mark.y}\n textAnchor=\"end\"\n dominantBaseline=\"middle\"\n fontSize={10}\n fill=\"#666666\"\n >\n {mark.label}\n </text>\n </g>\n ))}\n\n <polyline\n points={layout.fxLine.map((point) => `${point.x},${point.y}`).join(\" \")}\n fill=\"none\"\n stroke=\"#333333\"\n strokeWidth={1.5}\n />\n <line\n x1={layout.gridLeft}\n x2={layout.gridRight}\n y1={layout.separatorY}\n y2={layout.separatorY}\n stroke=\"#888888\"\n strokeWidth={1}\n strokeDasharray=\"4 4\"\n />\n\n <XAxis\n ticks={layout.xTicks}\n spine={layout.xSpine}\n title={layout.xTitle}\n plotBottom={layout.plotBottom}\n tickFontSize={10}\n />\n\n <g aria-hidden=\"true\">\n {[layout.spines.left, layout.spines.right].map((spine, index) => (\n <line\n key={`spine-${index}`}\n x1={spine.x}\n x2={spine.x}\n y1={spine.y1}\n y2={spine.y2}\n stroke=\"#333333\"\n strokeWidth={1}\n />\n ))}\n {layout.yTicks.map((tick, index) => (\n <line\n key={`ytick-${index}`}\n x1={tick.x1}\n x2={tick.x2}\n y1={tick.y}\n y2={tick.y}\n stroke=\"#333333\"\n strokeWidth={1}\n />\n ))}\n </g>\n\n {layout.rows.map((row, rowIndex) => (\n <g\n key={`row-${rowIndex}`}\n onClick={() => onFeatureClick?.(row.featureIndex)}\n style={{ cursor: onFeatureClick ? \"pointer\" : \"default\" }}\n >\n <text\n x={250}\n y={row.centerY}\n textAnchor=\"end\"\n dominantBaseline=\"middle\"\n fontSize={13}\n fill=\"#333333\"\n fontStyle={row.isOtherRow ? \"normal\" : \"italic\"}\n >\n {row.label}\n </text>\n {row.cells.map((cell, columnIndex) => (\n <rect\n key={`cell-${columnIndex}`}\n x={cell.x}\n y={cell.y}\n width={cell.width}\n height={cell.height}\n fill={cell.color}\n />\n ))}\n <rect\n x={row.sideBar.x}\n y={row.sideBar.y}\n width={row.sideBar.width}\n height={row.sideBar.height}\n fill=\"#777777\"\n />\n </g>\n ))}\n\n {activeColumn && (\n <rect\n x={activeColumn.x}\n y={8}\n width={activeColumn.width}\n height={layout.plotBottom - 8}\n fill=\"#000000\"\n fillOpacity={0.1}\n pointerEvents=\"none\"\n />\n )}\n\n {layout.columns.map((column, columnIndex) => (\n <rect\n key={`column-hit-${column.sampleIndex}`}\n x={column.x}\n y={8}\n width={column.width}\n height={layout.plotBottom - 8}\n fill=\"transparent\"\n aria-label={`${nameOf(column)}, total SHAP value ${formatShapValue(column.total)}`}\n onMouseEnter={() => setHoveredColumn(columnIndex)}\n onMouseLeave={() => setHoveredColumn(null)}\n onClick={() => {\n if (column.sampleId !== undefined) onSampleClick?.(column.sampleId);\n }}\n style={{ cursor: column.sampleId && onSampleClick ? \"pointer\" : \"default\" }}\n />\n ))}\n\n {activeColumn && (\n <g pointerEvents=\"none\" transform={`translate(${tooltipX} 10)`}>\n <rect x={0} y={0} width={tooltipWidth} height={42} rx={3} fill=\"#ffffff\" stroke=\"#cccccc\" />\n <text x={7} y={15} fontSize={11} fill=\"#222222\">\n {nameOf(activeColumn)}\n </text>\n <text x={7} y={31} fontSize={11} fill=\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G,GAAG,GAAG,GAAG,OAAO,cAAc,QAAQ,IAAI,IAAI,GAAG,MAAK,WAAU,QAAO,WAAU;AAAA,MAC1F,gBAAAA,KAAC,UAAK,GAAG,GAAG,GAAG,IAAI,UAAU,IAAI,MAAK,WACnC,iBAAO,YAAY,GACtB;AAAA,MACA,gBAAAA,KAAC,UAAK,GAAG,GAAG,GAAG,IAAI,UAAU,IAAI,MAAK,WACnC,2BAAO,gBAAgB,aAAa,KAAK,CAAC,IAC7C;AAAA,OACF;AAAA,KAEJ;AAEJ;","names":["jsx","jsxs","useMemo","useState","jsx","jsxs","useState","useMemo","useMemo","useState","jsx","jsxs","useState","useMemo","useMemo","useState","jsx","jsxs","useState","useMemo"]}
package/package.json ADDED
@@ -0,0 +1,94 @@
1
+ {
2
+ "name": "shap-svg",
3
+ "version": "0.1.0",
4
+ "description": "Interactive SVG charts for SHAP explanations — bar, beeswarm, heatmap and waterfall — drawn in the browser from SHAP values, with a framework-free core and React components.",
5
+ "license": "MIT",
6
+ "author": "Pongsakorn P.",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/princepongsakorn/shap-svg.git"
10
+ },
11
+ "homepage": "https://github.com/princepongsakorn/shap-svg#readme",
12
+ "bugs": {
13
+ "url": "https://github.com/princepongsakorn/shap-svg/issues"
14
+ },
15
+ "keywords": [
16
+ "shap",
17
+ "explainable-ai",
18
+ "xai",
19
+ "interpretability",
20
+ "svg",
21
+ "react",
22
+ "beeswarm",
23
+ "waterfall",
24
+ "heatmap",
25
+ "microbiome"
26
+ ],
27
+ "type": "module",
28
+ "main": "./dist/index.cjs",
29
+ "module": "./dist/index.js",
30
+ "types": "./dist/index.d.ts",
31
+ "exports": {
32
+ ".": {
33
+ "import": {
34
+ "types": "./dist/index.d.ts",
35
+ "default": "./dist/index.js"
36
+ },
37
+ "require": {
38
+ "types": "./dist/index.d.cts",
39
+ "default": "./dist/index.cjs"
40
+ }
41
+ },
42
+ "./react": {
43
+ "import": {
44
+ "types": "./dist/react.d.ts",
45
+ "default": "./dist/react.js"
46
+ },
47
+ "require": {
48
+ "types": "./dist/react.d.cts",
49
+ "default": "./dist/react.cjs"
50
+ }
51
+ },
52
+ "./package.json": "./package.json"
53
+ },
54
+ "typesVersions": {
55
+ "*": {
56
+ "react": [
57
+ "./dist/react.d.ts"
58
+ ]
59
+ }
60
+ },
61
+ "files": [
62
+ "dist",
63
+ "README.md",
64
+ "LICENSE"
65
+ ],
66
+ "sideEffects": false,
67
+ "engines": {
68
+ "node": ">=18"
69
+ },
70
+ "scripts": {
71
+ "build": "tsup",
72
+ "test": "vitest run",
73
+ "typecheck": "tsc --noEmit",
74
+ "prepublishOnly": "npm run typecheck && npm test && npm run build"
75
+ },
76
+ "peerDependencies": {
77
+ "react": ">=18"
78
+ },
79
+ "peerDependenciesMeta": {
80
+ "react": {
81
+ "optional": true
82
+ }
83
+ },
84
+ "devDependencies": {
85
+ "@types/node": "^20.19.43",
86
+ "@types/react": "^18.3.0",
87
+ "@types/react-dom": "^18.3.0",
88
+ "react": "^18.3.1",
89
+ "react-dom": "^18.3.1",
90
+ "tsup": "^8.5.1",
91
+ "typescript": "^5.6.0",
92
+ "vitest": "^2.1.0"
93
+ }
94
+ }