@milaboratories/miplots4 1.0.130 → 1.0.132

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.
Files changed (75) hide show
  1. package/dist/heatmap/components/Annotations/Annotation.d.ts.map +1 -1
  2. package/dist/heatmap/components/Annotations/Annotation.js +34 -33
  3. package/dist/heatmap/components/Annotations/Annotation.js.map +1 -1
  4. package/dist/heatmap/components/Chart.d.ts.map +1 -1
  5. package/dist/heatmap/components/Chart.js +90 -85
  6. package/dist/heatmap/components/Chart.js.map +1 -1
  7. package/dist/heatmap/components/types.d.ts +2 -1
  8. package/dist/heatmap/components/types.d.ts.map +1 -1
  9. package/dist/scatterplot/ScatterplotSettingsImpl.d.ts +6 -3
  10. package/dist/scatterplot/ScatterplotSettingsImpl.d.ts.map +1 -1
  11. package/dist/scatterplot/ScatterplotSettingsImpl.js +59 -60
  12. package/dist/scatterplot/ScatterplotSettingsImpl.js.map +1 -1
  13. package/dist/scatterplot/components/ChartTooltip.d.ts.map +1 -1
  14. package/dist/scatterplot/components/ChartTooltip.js +42 -40
  15. package/dist/scatterplot/components/ChartTooltip.js.map +1 -1
  16. package/dist/scatterplot/dots.d.ts +2 -1
  17. package/dist/scatterplot/dots.d.ts.map +1 -1
  18. package/dist/scatterplot/dots.js +26 -27
  19. package/dist/scatterplot/dots.js.map +1 -1
  20. package/dist/scatterplot/getLayersData.d.ts.map +1 -1
  21. package/dist/scatterplot/getLayersData.js +15 -12
  22. package/dist/scatterplot/getLayersData.js.map +1 -1
  23. package/dist/scatterplot/index.d.ts.map +1 -1
  24. package/dist/scatterplot/index.js +66 -72
  25. package/dist/scatterplot/index.js.map +1 -1
  26. package/dist/scatterplot/utils/createLegendInfo.d.ts +3 -3
  27. package/dist/scatterplot/utils/createLegendInfo.d.ts.map +1 -1
  28. package/dist/scatterplot/utils/createLegendInfo.js +44 -39
  29. package/dist/scatterplot/utils/createLegendInfo.js.map +1 -1
  30. package/dist/scatterplot/utils/formatColumnValue.d.ts +5 -0
  31. package/dist/scatterplot/utils/formatColumnValue.d.ts.map +1 -0
  32. package/dist/scatterplot/utils/formatColumnValue.js +11 -0
  33. package/dist/scatterplot/utils/formatColumnValue.js.map +1 -0
  34. package/dist/scatterplot/utils/sortDotsByGrouping.d.ts +8 -0
  35. package/dist/scatterplot/utils/sortDotsByGrouping.d.ts.map +1 -0
  36. package/dist/scatterplot/utils/sortDotsByGrouping.js +18 -0
  37. package/dist/scatterplot/utils/sortDotsByGrouping.js.map +1 -0
  38. package/dist/scatterplot-umap/SettingsImpl.d.ts +6 -3
  39. package/dist/scatterplot-umap/SettingsImpl.d.ts.map +1 -1
  40. package/dist/scatterplot-umap/SettingsImpl.js +54 -55
  41. package/dist/scatterplot-umap/SettingsImpl.js.map +1 -1
  42. package/dist/scatterplot-umap/components/LowerSVG.d.ts.map +1 -1
  43. package/dist/scatterplot-umap/components/LowerSVG.js +88 -86
  44. package/dist/scatterplot-umap/components/LowerSVG.js.map +1 -1
  45. package/dist/scatterplot-umap/index.d.ts.map +1 -1
  46. package/dist/scatterplot-umap/index.js +98 -92
  47. package/dist/scatterplot-umap/index.js.map +1 -1
  48. package/dist/types/bubble.d.ts +44 -12
  49. package/dist/types/bubble.d.ts.map +1 -1
  50. package/dist/types/common.d.ts +18 -0
  51. package/dist/types/common.d.ts.map +1 -1
  52. package/dist/types/common.js +2 -0
  53. package/dist/types/common.js.map +1 -1
  54. package/dist/types/dendro.d.ts +111 -8
  55. package/dist/types/dendro.d.ts.map +1 -1
  56. package/dist/types/discrete.d.ts +105 -28
  57. package/dist/types/discrete.d.ts.map +1 -1
  58. package/dist/types/heatmap.d.ts +187 -28
  59. package/dist/types/heatmap.d.ts.map +1 -1
  60. package/dist/types/histogram.d.ts +42 -20
  61. package/dist/types/histogram.d.ts.map +1 -1
  62. package/dist/types/scatterplot-umap.d.ts +259 -71
  63. package/dist/types/scatterplot-umap.d.ts.map +1 -1
  64. package/dist/types/scatterplot-umap.js +22 -16
  65. package/dist/types/scatterplot-umap.js.map +1 -1
  66. package/dist/types/scatterplot.d.ts +273 -71
  67. package/dist/types/scatterplot.d.ts.map +1 -1
  68. package/dist/types/scatterplot.js +16 -10
  69. package/dist/types/scatterplot.js.map +1 -1
  70. package/dist/utils/arraysAreDifferent.d.ts +2 -0
  71. package/dist/utils/arraysAreDifferent.d.ts.map +1 -0
  72. package/dist/utils/arraysAreDifferent.js +7 -0
  73. package/dist/utils/arraysAreDifferent.js.map +1 -0
  74. package/dist/utils/getChartEdgeSides.d.ts +1 -1
  75. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"createLegendInfo.js","sources":["../../../src/scatterplot/utils/createLegendInfo.ts"],"sourcesContent":["import { MAX_SHOWN_UNIQUE_VALUES_IN_LABELS } from '../../constants';\nimport type { DataFrame } from '../../DataFrame';\nimport type {\n AesItem,\n Category,\n ColumnName,\n ContinuousAesFromColumn,\n InheritAesScatterplot,\n ScatterplotLayer,\n ScatterplotLegendInfo\n} from '../../types';\nimport type { ScatterplotSettingsImpl } from '../ScatterplotSettingsImpl';\n\nconst categoryIndexer = (() => {\n const map = new Map<string, Map<Category, number>>();\n const clear = () => map.clear();\n const getIndex = (columnName: ColumnName, category: Category): number => {\n let categoryMap = map.get(columnName.value);\n if (categoryMap === undefined) {\n categoryMap = new Map();\n map.set(columnName.value, categoryMap);\n }\n let index = categoryMap.get(category);\n if (index === undefined) {\n index = categoryMap.size;\n categoryMap.set(category, index);\n }\n return index;\n };\n\n return {\n clear,\n getIndex,\n };\n})();\n\nexport function addPalettesToAesMapping(\n columnName: ColumnName,\n usedAesFromPalettes: Partial<Record<keyof AesItem, string[]>>,\n inheritedAes?: ScatterplotSettingsImpl['inheritedAes'][string],\n) {\n categoryIndexer.clear();\n const hasIngeritedAes = inheritedAes && Object.keys(inheritedAes).length > 0;\n const dotFill = usedAesFromPalettes['dotFill'];\n const hasDotFill = dotFill && dotFill.length > 0;\n const lineColor = usedAesFromPalettes['lineColor'];\n const hasLineColor = lineColor && lineColor.length > 0;\n const getAesField = (category: Category, field: keyof AesItem) => {\n const inheritedResult = hasIngeritedAes ? inheritedAes[category]?.[field] : undefined;\n \n if (field === 'dotFill' && hasDotFill) {\n return dotFill[categoryIndexer.getIndex(columnName, category) % dotFill.length] ?? inheritedResult;\n }\n if (field === 'lineColor' && hasLineColor) {\n return lineColor[categoryIndexer.getIndex(columnName, category) % lineColor.length] ?? inheritedResult;\n }\n \n return inheritedResult;\n };\n\n return getAesField;\n}\n\nfunction isInheritMapping<T extends (string | number)>(value:T | InheritAesScatterplot | ContinuousAesFromColumn<T>):value is InheritAesScatterplot {\n return typeof value === 'object' && 'type' in value && value.type === 'grouping';\n}\nexport function createLegendInfo(\n data: DataFrame,\n grouping: ColumnName[],\n layers: ScatterplotLayer[],\n inheritedAes: ScatterplotSettingsImpl['inheritedAes']\n): ScatterplotLegendInfo {\n return grouping.reduce((res: ScatterplotLegendInfo, column) => {\n // TODO: remove String conversion\n const getValueLabel = (index: number) => {\n return column.valueLabels\n ? data.getColumnValueCategory(column.valueLabels, index)\n : undefined;\n };\n\n const usedAes = new Set<keyof AesItem>();\n const usedAesFromPalettes:Partial<Record<keyof AesItem, string[]>> = {}; // if there is palette in mapping then\n layers.forEach(layer => {\n if (!layer.aes) return;\n \n Object.entries(layer.aes).forEach(([key, value]) => {\n if (!(isInheritMapping(value) && value.value === column.value)) return;\n \n usedAes.add(key as keyof AesItem);\n usedAesFromPalettes[key as keyof AesItem] = value.palette;\n });\n });\n let labels: Record<Category, string> = {};\n let values: Category[] = [];\n if (usedAes.has('dotFill') || usedAes.has('dotShape')) {\n const categories = data.getColumnCategories(column.value);\n if (categories.length < MAX_SHOWN_UNIQUE_VALUES_IN_LABELS) {\n labels = categories.reduce((res, category) => {\n const index = data.getColumnCategoryRowIndex(column.value, category);\n res[category] = getValueLabel(index) ?? category;\n return res;\n }, labels);\n values = categories.sort((a, b) => labels[a]?.localeCompare(labels[b] ?? '', 'en', {numeric: true}) ?? 0);\n } else {\n values = categories;\n }\n }\n res[column.value] = {\n values,\n usedAes: [...usedAes],\n aesMap: addPalettesToAesMapping(column, usedAesFromPalettes, inheritedAes[column.value]),\n labels,\n };\n return res;\n }, {});\n}"],"names":["categoryIndexer","map","columnName","category","categoryMap","index","addPalettesToAesMapping","usedAesFromPalettes","inheritedAes","hasIngeritedAes","dotFill","hasDotFill","lineColor","hasLineColor","field","inheritedResult","_a","isInheritMapping","value","createLegendInfo","data","grouping","layers","res","column","getValueLabel","usedAes","layer","key","labels","values","categories","MAX_SHOWN_UNIQUE_VALUES_IN_LABELS","a","b"],"mappings":";AAaA,MAAMA,IAAmB,uBAAM;AAC3B,QAAMC,wBAAU,IAAA;AAgBhB,SAAO;AAAA,IACH,OAhBU,MAAMA,EAAI,MAAA;AAAA,IAiBpB,UAhBa,CAACC,GAAwBC,MAA+B;AACrE,UAAIC,IAAcH,EAAI,IAAIC,EAAW,KAAK;AAC1C,MAAIE,MAAgB,WAChBA,wBAAkB,IAAA,GAClBH,EAAI,IAAIC,EAAW,OAAOE,CAAW;AAEzC,UAAIC,IAAQD,EAAY,IAAID,CAAQ;AACpC,aAAIE,MAAU,WACVA,IAAQD,EAAY,MACpBA,EAAY,IAAID,GAAUE,CAAK,IAE5BA;AAAA,IACX;AAAA,EAII;AAER,GAAA;AAEO,SAASC,EACZJ,GACAK,GACAC,GACF;AACE,EAAAR,EAAgB,MAAA;AAChB,QAAMS,IAAkBD,KAAgB,OAAO,KAAKA,CAAY,EAAE,SAAS,GACrEE,IAAUH,EAAoB,SAC9BI,IAAaD,KAAWA,EAAQ,SAAS,GACzCE,IAAYL,EAAoB,WAChCM,IAAeD,KAAaA,EAAU,SAAS;AAcrD,SAboB,CAACT,GAAoBW,MAAyB;;AAC9D,UAAMC,IAAkBN,KAAkBO,IAAAR,EAAaL,CAAQ,MAArB,gBAAAa,EAAyBF,KAAS;AAE5E,WAAIA,MAAU,aAAaH,IAChBD,EAAQV,EAAgB,SAASE,GAAYC,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jB,EAAW,cAAca,EAAOK,CAAC,KAAK,IAAI,MAAM,EAAC,SAAS,GAAA,OAAU;AAAA,OAAC,KAExGJ,IAASC;AAAA,IAEjB;AACA,WAAAR,EAAIC,EAAO,KAAK,IAAI;AAAA,MAChB,QAAAM;AAAA,MACA,SAAS,CAAC,GAAGJ,CAAO;AAAA,MACpB,QAAQpB,EAAwBkB,GAAQjB,GAAqBC,EAAagB,EAAO,KAAK,CAAC;AAAA,MACvF,QAAAK;AAAA,IAAA,GAEGN;AAAA,EACX,GAAG,CAAA,CAAE;AACT;"}
1
+ {"version":3,"file":"createLegendInfo.js","sources":["../../../src/scatterplot/utils/createLegendInfo.ts"],"sourcesContent":["import { MAX_SHOWN_UNIQUE_VALUES_IN_LABELS } from '../../constants';\nimport type { DataFrame } from '../../DataFrame';\nimport type {AesRecord} from '../../types';\nimport type {\n AesItem,\n Category,\n ColumnName,\n ContinuousAesFromColumn,\n InheritAesScatterplot,\n ScatterplotLayer,\n ScatterplotLegendInfo\n} from '../../types';\nimport type { ScatterplotSettingsImpl } from '../ScatterplotSettingsImpl';\n\nconst categoryIndexer = (() => {\n const map = new Map<string, Map<Category, number>>();\n const clear = () => map.clear();\n const getIndex = (columnName: ColumnName, category: Category): number => {\n let categoryMap = map.get(columnName.value);\n if (categoryMap === undefined) {\n categoryMap = new Map();\n map.set(columnName.value, categoryMap);\n }\n let index = categoryMap.get(category);\n if (index === undefined) {\n index = categoryMap.size;\n categoryMap.set(category, index);\n }\n return index;\n };\n\n return {\n clear,\n getIndex,\n };\n})();\n\nexport function addPalettesToAesMapping(\n columnName: ColumnName,\n usedAesFromPalettes: Partial<Record<keyof AesItem, string[]>>,\n inheritedAes?: AesRecord\n) {\n categoryIndexer.clear();\n const hasInheritedAes = inheritedAes && Object.keys(inheritedAes).length > 0;\n const dotFill = usedAesFromPalettes['dotFill'];\n const hasDotFill = dotFill && dotFill.length > 0;\n const lineColor = usedAesFromPalettes['lineColor'];\n const hasLineColor = lineColor && lineColor.length > 0;\n const getAesField = (category: Category, field: keyof AesItem) => {\n const inheritedResult = hasInheritedAes ? inheritedAes[category]?.[field] : undefined;\n \n if (field === 'dotFill' && hasDotFill) {\n return dotFill[categoryIndexer.getIndex(columnName, category) % dotFill.length] ?? inheritedResult;\n }\n if (field === 'lineColor' && hasLineColor) {\n return lineColor[categoryIndexer.getIndex(columnName, category) % lineColor.length] ?? inheritedResult;\n }\n \n return inheritedResult;\n };\n\n return getAesField;\n}\n\nfunction isInheritMapping<T extends (string | number)>(value:T | InheritAesScatterplot | ContinuousAesFromColumn<T>):value is InheritAesScatterplot {\n return typeof value === 'object' && 'type' in value && value.type === 'grouping';\n}\nexport function createLegendInfo(\n data: DataFrame,\n grouping: ScatterplotSettingsImpl['grouping'],\n layers: ScatterplotLayer[],\n): ScatterplotLegendInfo {\n return grouping.reduce((res: ScatterplotLegendInfo, groupingElement) => {\n // TODO: remove String conversion\n const column = groupingElement.columnName;\n const order = groupingElement.order;\n const getValueLabel = (index: number) => {\n return column.valueLabels\n ? data.getColumnValueCategory(column.valueLabels, index)\n : undefined;\n };\n\n const usedAes = new Set<keyof AesItem>();\n const usedAesFromPalettes:Partial<Record<keyof AesItem, string[]>> = {}; // if there is palette in mapping then\n layers.forEach(layer => {\n if (!layer.aes) return;\n \n Object.entries(layer.aes).forEach(([key, value]) => {\n if (!(isInheritMapping(value) && value.value === column.value)) return;\n \n usedAes.add(key as keyof AesItem);\n usedAesFromPalettes[key as keyof AesItem] = value.palette;\n });\n });\n let labels: Record<Category, string> = {};\n let values: Category[] = [];\n if (usedAes.has('dotFill') || usedAes.has('dotShape')) {\n const categories = data.getColumnCategories(column.value);\n if (categories.length < MAX_SHOWN_UNIQUE_VALUES_IN_LABELS) {\n labels = categories.reduce((res, category) => {\n const index = data.getColumnCategoryRowIndex(column.value, category);\n res[category] = getValueLabel(index) ?? category;\n return res;\n }, labels);\n const sortWeights = categories.reduce((res, v) => {\n res[v] = order?.indexOf(v) ?? -1;\n return res;\n }, {} as Record<string, number>);\n values = categories.sort((a, b) => {\n if (sortWeights[a] !== sortWeights[b]) {\n return sortWeights[a] - sortWeights[b];\n }\n return labels[a]?.localeCompare(labels[b] ?? '', 'en', {numeric: true}) ?? 0;\n });\n } else {\n values = categories;\n }\n }\n res[column.value] = {\n values,\n usedAes: [...usedAes],\n aesMap: addPalettesToAesMapping(column, usedAesFromPalettes, groupingElement.inheritedAes),\n labels,\n };\n return res;\n }, {});\n}"],"names":["categoryIndexer","map","columnName","category","categoryMap","index","addPalettesToAesMapping","usedAesFromPalettes","inheritedAes","hasInheritedAes","dotFill","hasDotFill","lineColor","hasLineColor","field","inheritedResult","_a","isInheritMapping","value","createLegendInfo","data","grouping","layers","res","groupingElement","column","order","getValueLabel","usedAes","layer","key","labels","values","categories","MAX_SHOWN_UNIQUE_VALUES_IN_LABELS","sortWeights","v","a","b"],"mappings":";AAcA,MAAMA,IAAmB,uBAAM;AAC3B,QAAMC,wBAAU,IAAA;AAgBhB,SAAO;AAAA,IACH,OAhBU,MAAMA,EAAI,MAAA;AAAA,IAiBpB,UAhBa,CAACC,GAAwBC,MAA+B;AACrE,UAAIC,IAAcH,EAAI,IAAIC,EAAW,KAAK;AAC1C,MAAIE,MAAgB,WAChBA,wBAAkB,IAAA,GAClBH,EAAI,IAAIC,EAAW,OAAOE,CAAW;AAEzC,UAAIC,IAAQD,EAAY,IAAID,CAAQ;AACpC,aAAIE,MAAU,WACVA,IAAQD,EAAY,MACpBA,EAAY,IAAID,GAAUE,CAAK,IAE5BA;AAAA,IACX;AAAA,EAII;AAER,GAAA;AAEO,SAASC,EACZJ,GACAK,GACAC,GACF;AACE,EAAAR,EAAgB,MAAA;AAChB,QAAMS,IAAkBD,KAAgB,OAAO,KAAKA,CAAY,EAAE,SAAS,GACrEE,IAAUH,EAAoB,SAC9BI,IAAaD,KAAWA,EAAQ,SAAS,GACzCE,IAAYL,EAAoB,WAChCM,IAAeD,KAAaA,EAAU,SAAS;AAcrD,SAboB,CAACT,GAAo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EAAO,OAAOtB,CAAQ;AACnEoB,iBAAAA,EAAIpB,CAAQ,IAAIwB,EAActB,CAAK,KAAKF,GACjCoB;AAAAA,QACX,GAAGQ,CAAM;AACT,cAAMI,IAAcF,EAAW,OAAO,CAACV,GAAKa,OACxCb,EAAIa,CAAC,KAAIV,KAAA,gBAAAA,EAAO,QAAQU,OAAM,IACvBb,IACR,CAAA,CAA4B;AAC/B,QAAAS,IAASC,EAAW,KAAK,CAACI,GAAGC,MAAM;;AAC/B,iBAAIH,EAAYE,CAAC,MAAMF,EAAYG,CAAC,IACzBH,EAAYE,CAAC,IAAIF,EAAYG,CAAC,MAElCtB,IAAAe,EAAOM,CAAC,MAAR,gBAAArB,EAAW,cAAce,EAAOO,CAAC,KAAK,IAAI,MAAM,EAAC,SAAS,GAAA,OAAU;AAAA,QAC/E,CAAC;AAAA,MACL;AACI,QAAAN,IAASC;AAAA,IAEjB;AACA,WAAAV,EAAIE,EAAO,KAAK,IAAI;AAAA,MAChB,QAAAO;AAAA,MACA,SAAS,CAAC,GAAGJ,CAAO;AAAA,MACpB,QAAQtB,EAAwBmB,GAAQlB,GAAqBiB,EAAgB,YAAY;AAAA,MACzF,QAAAO;AAAA,IAAA,GAEGR;AAAA,EACX,GAAG,CAAA,CAAE;AACT;"}
@@ -0,0 +1,5 @@
1
+ import { DataFrame } from '../../DataFrame';
2
+ import { ColumnName } from '../../types';
3
+ import { numberFormat } from '../../utils/numberFormat';
4
+ export declare function formatColumnValue(data: DataFrame, rowIdx: number, column: ColumnName | null | undefined, numberFormatter?: typeof numberFormat): string | null;
5
+ //# sourceMappingURL=formatColumnValue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"formatColumnValue.d.ts","sourceRoot":"","sources":["../../../src/scatterplot/utils/formatColumnValue.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,iBAAiB,CAAC;AAC/C,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAC,YAAY,EAAC,MAAM,0BAA0B,CAAC;AAEtD,wBAAgB,iBAAiB,CAAC,IAAI,EAAC,SAAS,EAAE,MAAM,EAAC,MAAM,EAAE,MAAM,EAAC,UAAU,GAAG,IAAI,GAAG,SAAS,EAAE,eAAe,sBAAe,iBAUpI"}
@@ -0,0 +1,11 @@
1
+ import { numberFormat as l } from "../../utils/numberFormat.js";
2
+ function m(u, t, r, n = l) {
3
+ if (!r)
4
+ return null;
5
+ const e = u.getColumnValue(r.valueLabels ?? r.value, t);
6
+ return !(typeof e == "number") || e === null ? e : n(e);
7
+ }
8
+ export {
9
+ m as formatColumnValue
10
+ };
11
+ //# sourceMappingURL=formatColumnValue.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"formatColumnValue.js","sources":["../../../src/scatterplot/utils/formatColumnValue.ts"],"sourcesContent":["import type {DataFrame} from '../../DataFrame';\nimport type {ColumnName} from '../../types';\nimport {numberFormat} from '../../utils/numberFormat';\n\nexport function formatColumnValue(data:DataFrame, rowIdx:number, column:ColumnName | null | undefined, numberFormatter = numberFormat) {\n if (!column) {\n return null;\n }\n const value = data.getColumnValue(column.valueLabels ?? column.value, rowIdx);\n const isNumber = typeof value === 'number';\n if (!isNumber || value === null) {\n return value;\n }\n return numberFormatter(value);\n}"],"names":["formatColumnValue","data","rowIdx","column","numberFormatter","numberFormat","value"],"mappings":";AAIO,SAASA,EAAkBC,GAAgBC,GAAeC,GAAsCC,IAAkBC,GAAc;AACnI,MAAI,CAACF;AACD,WAAO;AAEX,QAAMG,IAAQL,EAAK,eAAeE,EAAO,eAAeA,EAAO,OAAOD,CAAM;AAE5E,SAAI,EADa,OAAOI,KAAU,aACjBA,MAAU,OAChBA,IAEJF,EAAgBE,CAAK;AAChC;"}
@@ -0,0 +1,8 @@
1
+ import { DataFrame } from '../../DataFrame';
2
+ import { ColumnName, DataValue } from '../../types';
3
+ import { Dot } from '../dots';
4
+ export declare function sortDotsByGrouping(dataFrame: DataFrame, dots: Dot[], grouping: {
5
+ columnName: ColumnName;
6
+ order?: DataValue[];
7
+ }[], highlight: ColumnName | null): void;
8
+ //# sourceMappingURL=sortDotsByGrouping.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sortDotsByGrouping.d.ts","sourceRoot":"","sources":["../../../src/scatterplot/utils/sortDotsByGrouping.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,iBAAiB,CAAC;AAC/C,OAAO,KAAK,EAAC,UAAU,EAAE,SAAS,EAAC,MAAM,aAAa,CAAC;AACvD,OAAO,KAAK,EAAC,GAAG,EAAC,MAAM,SAAS,CAAC;AAEjC,wBAAgB,kBAAkB,CAC9B,SAAS,EAAE,SAAS,EACpB,IAAI,EAAC,GAAG,EAAE,EACV,QAAQ,EAAE;IAAC,UAAU,EAAE,UAAU,CAAC;IAAC,KAAK,CAAC,EAAE,SAAS,EAAE,CAAC;CAAC,EAAE,EAC1D,SAAS,EAAE,UAAU,GAAG,IAAI,QA2B/B"}
@@ -0,0 +1,18 @@
1
+ function v(r, s, i, f) {
2
+ const c = i.reduce((t, { columnName: n, order: e }) => (e && (t[n.value] = e.reduce((o, u, l) => (o[u] = e.length - l, o), {})), t), {});
3
+ s.sort((t, n) => {
4
+ var e, o;
5
+ if (f && n.dimmed !== t.dimmed)
6
+ return n.dimmed ? 1 : -1;
7
+ for (const { columnName: u } of i) {
8
+ const l = r.getColumnValue(u.value, t.idx), d = r.getColumnValue(u.value, n.idx), m = (e = c[u.value]) == null ? void 0 : e[l], a = (o = c[u.value]) == null ? void 0 : o[d];
9
+ if (m !== a)
10
+ return m - a;
11
+ }
12
+ return 0;
13
+ });
14
+ }
15
+ export {
16
+ v as sortDotsByGrouping
17
+ };
18
+ //# sourceMappingURL=sortDotsByGrouping.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sortDotsByGrouping.js","sources":["../../../src/scatterplot/utils/sortDotsByGrouping.ts"],"sourcesContent":["import type {DataFrame} from '../../DataFrame';\nimport type {ColumnName, DataValue} from '../../types';\nimport type {Dot} from '../dots';\n\nexport function sortDotsByGrouping(\n dataFrame: DataFrame,\n dots:Dot[],\n grouping: {columnName: ColumnName; order?: DataValue[];}[],\n highlight: ColumnName | null\n) {\n const weightsByColumnByOrder = grouping.reduce((res, {columnName, order}) => {\n if (order) {\n res[columnName.value] = order.reduce((weights, orderEl, idx) => {\n weights[orderEl as string] = order.length - idx;\n return weights;\n }, {} as Record<string, number>);\n }\n return res;\n }, {} as Record<string, Record<string, number>>);\n\n dots.sort((d1, d2) => {\n if (highlight && d2.dimmed !== d1.dimmed) {\n return d2.dimmed ? 1 : -1;\n }\n for (const {columnName} of grouping) {\n const aValue = dataFrame.getColumnValue(columnName.value, d1.idx);\n const bValue = dataFrame.getColumnValue(columnName.value, d2.idx);\n const aWeight = weightsByColumnByOrder[columnName.value]?.[aValue as string];\n const bWeight = weightsByColumnByOrder[columnName.value]?.[bValue as string];\n if (aWeight !== bWeight) {\n return aWeight - bWeight;\n }\n }\n return 0;\n });\n}"],"names":["sortDotsByGrouping","dataFrame","dots","grouping","highlight","weightsByColumnByOrder","res","columnName","order","weights","orderEl","idx","d1","d2","_a","_b","aValue","bValue","aWeight","bWeight"],"mappings":"AAIO,SAASA,EACZC,GACAC,GACAC,GACAC,GACF;AACE,QAAMC,IAAyBF,EAAS,OAAO,CAACG,GAAK,EAAC,YAAAC,GAAY,OAAAC,SAC1DA,MACAF,EAAIC,EAAW,KAAK,IAAIC,EAAM,OAAO,CAACC,GAASC,GAASC,OACpDF,EAAQC,CAAiB,IAAIF,EAAM,SAASG,GACrCF,IACR,CAAA,CAA4B,IAE5BH,IACR,CAAA,CAA4C;AAE/C,EAAAJ,EAAK,KAAK,CAACU,GAAIC,MAAO;AAhBnB,QAAAC,GAAAC;AAiBC,QAAIX,KAAaS,EAAG,WAAWD,EAAG;AAC9B,aAAOC,EAAG,SAAS,IAAI;AAE3B,eAAW,EAAC,YAAAN,EAAA,KAAeJ,GAAU;AACjC,YAAMa,IAASf,EAAU,eAAeM,EAAW,OAAOK,EAAG,GAAG,GAC1DK,IAAShB,EAAU,eAAeM,EAAW,OAAOM,EAAG,GAAG,GAC1DK,KAAUJ,IAAAT,EAAuBE,EAAW,KAAK,MAAvC,gBAAAO,EAA2CE,IACrDG,KAAUJ,IAAAV,EAAuBE,EAAW,KAAK,MAAvC,gBAAAQ,EAA2CE;AAC3D,UAAIC,MAAYC;AACZ,eAAOD,IAAUC;AAAA,IAEzB;AACA,WAAO;AAAA,EACX,CAAC;AACL;"}
@@ -1,5 +1,5 @@
1
1
  import { ScatterplotAxisSettings } from '../scatterplot/ScatterplotSettingsImpl';
2
- import { ColumnName, ContinuousAesFromColumn, FrameType, LegendPosition, LineShape, SettingsInterface, TitlePosition, AesRecord, InheritAesScatterplot, PointShape } from '../types';
2
+ import { ColumnName, ContinuousAesFromColumn, DataValue, FrameType, LegendPosition, LineShape, SettingsInterface, TitlePosition, AesRecord, InheritAesScatterplot, PointShape } from '../types';
3
3
  import { CurveUmapLayer as OuterCurveLayer, DotsUmapLayer as OuterDotsLayer, ScatterplotUmapSettings } from '../types/scatterplot-umap';
4
4
  export declare class DotsLayer {
5
5
  readonly type = "dots";
@@ -29,7 +29,11 @@ export declare class ScatterplotUmapSettingsImpl implements SettingsInterface {
29
29
  readonly keyColumn: ColumnName | null;
30
30
  readonly x: ColumnName;
31
31
  readonly y: ColumnName;
32
- readonly grouping: ColumnName[];
32
+ readonly grouping: {
33
+ columnName: ColumnName;
34
+ order?: DataValue[];
35
+ inheritedAes?: AesRecord;
36
+ }[];
33
37
  readonly label: ColumnName | null;
34
38
  readonly highlight: ColumnName | null;
35
39
  readonly chartSettings: {
@@ -56,7 +60,6 @@ export declare class ScatterplotUmapSettingsImpl implements SettingsInterface {
56
60
  content?: ColumnName[];
57
61
  };
58
62
  };
59
- readonly inheritedAes: Record<string, AesRecord>;
60
63
  readonly layers: ScatterplotUmapLayer[];
61
64
  constructor(settings: ScatterplotUmapSettings);
62
65
  }
@@ -1 +1 @@
1
- {"version":3,"file":"SettingsImpl.d.ts","sourceRoot":"","sources":["../../src/scatterplot-umap/SettingsImpl.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,wCAAwC,CAAC;AACtF,OAAO,KAAK,EACR,UAAU,EACV,uBAAuB,EACvB,SAAS,EACT,cAAc,EACd,SAAS,EACT,iBAAiB,EACjB,aAAa,EAChB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,qBAAqB,EAAE,KAAK,UAAU,EAAE,MAAM,UAAU,CAAC;AACvF,OAAO,KAAK,EACR,cAAc,IAAI,eAAe,EACjC,aAAa,IAAI,cAAc,EAC/B,uBAAuB,EAC1B,MAAM,2BAA2B,CAAC;AAGnC,qBAAa,SAAS;IAClB,QAAQ,CAAC,IAAI,UAAU;IACvB,QAAQ,CAAC,GAAG,EAAE;QACV,OAAO,EAAE,MAAM,GAAG,qBAAqB,GAAG,uBAAuB,CAAC,MAAM,CAAC,CAAC;QAC1E,QAAQ,EAAE,UAAU,GAAG,qBAAqB,CAAC;QAC7C,OAAO,EAAE,MAAM,GAAG,uBAAuB,CAAC,MAAM,CAAC,CAAC;QAClD,OAAO,EAAE,MAAM,CAAC;KACnB,CAKC;gBACU,KAAK,EAAE,cAAc;CAMpC;AACD,qBAAa,UAAU;IACnB,QAAQ,CAAC,IAAI,WAAW;IACxB,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,GAAG,EAAE;QACV,SAAS,EAAE,MAAM,GAAG,qBAAqB,GAAG,uBAAuB,CAAC,MAAM,CAAC,CAAC;QAC5E,SAAS,EAAE,MAAM,CAAC;QAClB,SAAS,EAAE,SAAS,CAAC;QACrB,OAAO,EAAE,MAAM,CAAC;KACnB,CAKC;gBAEU,KAAK,EAAE,eAAe;CAOrC;AAED,MAAM,MAAM,oBAAoB,GAAG,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;IACF,QAAQ,CAAC,MAAM,EAAE,oBAAoB,EAAE,CAAC;gBAE5B,QAAQ,EAAE,uBAAuB;CA0DhD"}
@@ -1,101 +1,100 @@
1
- var u = Object.defineProperty;
2
- var c = (l, e, i) => e in l ? u(l, e, { enumerable: !0, configurable: !0, writable: !0, value: i }) : l[e] = i;
3
- var o = (l, e, i) => c(l, typeof e != "symbol" ? e + "" : e, i);
4
- import m from "../node_modules/lodash/lodash.js";
5
- import { DEFAULT_HEIGHT as y, DEFAULT_WIDTH as s, BLACK as p } from "../constants.js";
6
- import { ScatterplotUmapSettingsSchema as d } from "../types/scatterplot-umap.js";
7
- class n {
8
- constructor(e) {
9
- o(this, "type", "dots");
10
- o(this, "aes", {
11
- dotFill: p,
1
+ var m = Object.defineProperty;
2
+ var y = (l, o, r) => o in l ? m(l, o, { enumerable: !0, configurable: !0, writable: !0, value: r }) : l[o] = r;
3
+ var e = (l, o, r) => y(l, typeof o != "symbol" ? o + "" : o, r);
4
+ import s from "../node_modules/lodash/lodash.js";
5
+ import { DEFAULT_HEIGHT as d, DEFAULT_WIDTH as n, BLACK as c } from "../constants.js";
6
+ import { ScatterplotUmapSettingsSchema as w } from "../types/scatterplot-umap.js";
7
+ class x {
8
+ constructor(o) {
9
+ e(this, "type", "dots");
10
+ e(this, "aes", {
11
+ dotFill: c,
12
12
  dotShape: "21",
13
13
  dotSize: 3,
14
14
  opacity: 1
15
15
  });
16
16
  this.aes = {
17
17
  ...this.aes,
18
- ...e.aes
18
+ ...o.aes
19
19
  };
20
20
  }
21
21
  }
22
- class w {
23
- constructor(e) {
24
- o(this, "type", "curve");
25
- o(this, "smoothing");
26
- o(this, "aes", {
27
- lineColor: p,
22
+ class f {
23
+ constructor(o) {
24
+ e(this, "type", "curve");
25
+ e(this, "smoothing");
26
+ e(this, "aes", {
27
+ lineColor: c,
28
28
  lineWidth: 1,
29
29
  lineShape: "solid",
30
30
  opacity: 1
31
31
  });
32
- this.smoothing = e.smoothing ?? !1, this.aes = {
32
+ this.smoothing = o.smoothing ?? !1, this.aes = {
33
33
  ...this.aes,
34
- ...e.aes
34
+ ...o.aes
35
35
  };
36
36
  }
37
37
  }
38
- class C {
39
- constructor(e) {
40
- o(this, "id");
41
- o(this, "type", "scatterplot-umap");
42
- o(this, "keyColumn");
43
- o(this, "x");
44
- o(this, "y");
45
- o(this, "grouping");
46
- o(this, "label");
47
- o(this, "highlight");
48
- o(this, "chartSettings");
49
- o(this, "inheritedAes");
50
- o(this, "layers");
51
- var i, h, t, a;
52
- d.parse(e), this.id = m.uniqueId("settings"), this.keyColumn = e.keyColumn ?? null, this.x = e.x, this.y = e.y, this.grouping = e.grouping ?? [], this.label = e.label ?? null, this.highlight = e.highlight ?? null, this.chartSettings = {
38
+ class T {
39
+ constructor(o) {
40
+ e(this, "id");
41
+ e(this, "type", "scatterplot-umap");
42
+ e(this, "keyColumn");
43
+ e(this, "x");
44
+ e(this, "y");
45
+ e(this, "grouping");
46
+ e(this, "label");
47
+ e(this, "highlight");
48
+ e(this, "chartSettings");
49
+ e(this, "layers");
50
+ var r, i, a, t, p, u;
51
+ w.parse(o), this.id = s.uniqueId("settings"), this.keyColumn = o.keyColumn ?? null, this.x = o.x, this.y = o.y, this.grouping = o.grouping ?? [], this.label = o.label ?? null, this.highlight = o.highlight ?? null, this.chartSettings = {
53
52
  size: {
54
- width: ((i = e == null ? void 0 : e.size) == null ? void 0 : i.width) ?? s,
55
- height: ((h = e == null ? void 0 : e.size) == null ? void 0 : h.height) ?? y
53
+ width: ((r = o == null ? void 0 : o.size) == null ? void 0 : r.width) ?? n,
54
+ height: ((i = o == null ? void 0 : o.size) == null ? void 0 : i.height) ?? d
56
55
  },
57
56
  title: {
58
57
  position: "center",
59
58
  show: !0,
60
- ...e.title,
61
- name: ((t = e.title) == null ? void 0 : t.name) ?? "Chart"
59
+ ...o.title,
60
+ name: ((a = o.title) == null ? void 0 : a.name) ?? "Chart"
62
61
  },
63
62
  yAxis: {
64
- title: e.y.label ?? e.y.value,
63
+ title: o.y.label ?? o.y.value,
65
64
  scale: "linear",
66
65
  showGrid: !0,
67
66
  showTicks: !0,
68
- ...e.yAxis
67
+ ...o.yAxis
69
68
  },
70
69
  xAxis: {
71
- title: e.x.label ?? e.x.value,
70
+ title: o.x.label ?? o.x.value,
72
71
  scale: "linear",
73
72
  showGrid: !0,
74
73
  showTicks: !0,
75
- ...e.xAxis
74
+ ...o.xAxis
76
75
  },
77
- frame: { type: ((a = e.frame) == null ? void 0 : a.type) ?? "full" },
76
+ frame: { type: ((t = o.frame) == null ? void 0 : t.type) ?? "full" },
78
77
  legend: {
79
78
  show: !0,
80
79
  position: "right",
81
- ...e.legend
80
+ ...o.legend
82
81
  },
83
82
  tooltips: {
84
- show: !0,
85
- ...e.tooltips
83
+ ...o.tooltips,
84
+ show: ((p = o.tooltips) == null ? void 0 : p.show) !== !1 && (((u = o.tooltips) == null ? void 0 : u.content) ?? []).length > 0
86
85
  }
87
- }, this.inheritedAes = e.inheritedAes ?? {}, this.layers = e.layers.map((r) => {
88
- if (r.type === "dots")
89
- return new n(r);
90
- if (r.type === "curve")
91
- return new w(r);
86
+ }, this.layers = o.layers.map((h) => {
87
+ if (h.type === "dots")
88
+ return new x(h);
89
+ if (h.type === "curve")
90
+ return new f(h);
92
91
  throw new Error("Unknown layer type");
93
92
  }).filter(Boolean);
94
93
  }
95
94
  }
96
95
  export {
97
- w as CurveLayer,
98
- n as DotsLayer,
99
- C as ScatterplotUmapSettingsImpl
96
+ f as CurveLayer,
97
+ x as DotsLayer,
98
+ T as ScatterplotUmapSettingsImpl
100
99
  };
101
100
  //# sourceMappingURL=SettingsImpl.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SettingsImpl.js","sources":["../../src/scatterplot-umap/SettingsImpl.ts"],"sourcesContent":["import lodash from 'lodash';\nimport { BLACK, DEFAULT_HEIGHT, DEFAULT_WIDTH } from '../constants';\nimport type { ScatterplotAxisSettings } from '../scatterplot/ScatterplotSettingsImpl';\nimport type {\n ColumnName,\n ContinuousAesFromColumn,\n FrameType,\n LegendPosition,\n LineShape,\n SettingsInterface,\n TitlePosition,\n} from '../types';\nimport { type AesRecord, type InheritAesScatterplot, type PointShape } from '../types';\nimport type {\n CurveUmapLayer as OuterCurveLayer,\n DotsUmapLayer as OuterDotsLayer,\n ScatterplotUmapSettings\n} from '../types/scatterplot-umap';\nimport { ScatterplotUmapSettingsSchema } from '../types/scatterplot-umap';\n\nexport class DotsLayer {\n readonly type = 'dots';\n readonly aes: {\n dotFill: string | InheritAesScatterplot | ContinuousAesFromColumn<string>;\n dotShape: PointShape | InheritAesScatterplot;\n dotSize: number | ContinuousAesFromColumn<number>;\n opacity: number;\n } = {\n dotFill: BLACK,\n dotShape: '21',\n dotSize: 3,\n opacity: 1,\n };\n constructor(layer: OuterDotsLayer) {\n this.aes = {\n ...this.aes,\n ...layer.aes,\n };\n }\n}\nexport class CurveLayer {\n readonly type = 'curve';\n readonly smoothing: boolean;\n readonly aes: {\n lineColor: string | InheritAesScatterplot | ContinuousAesFromColumn<string>;\n lineWidth: number;\n lineShape: LineShape;\n opacity: number;\n } = {\n lineColor: BLACK,\n lineWidth: 1,\n lineShape: 'solid',\n opacity: 1,\n };\n\n constructor(layer: OuterCurveLayer) {\n this.smoothing = layer.smoothing ?? false;\n this.aes = {\n ...this.aes,\n ...layer.aes,\n };\n }\n}\n\nexport type ScatterplotUmapLayer = DotsLayer | CurveLayer;\n\nexport class ScatterplotUmapSettingsImpl implements SettingsInterface {\n readonly id: string;\n readonly type = 'scatterplot-umap';\n readonly keyColumn: ColumnName | null;\n readonly x: ColumnName;\n readonly y: ColumnName;\n readonly grouping: ColumnName[];\n readonly label: ColumnName | null;\n readonly highlight: ColumnName | null;\n readonly chartSettings: {\n readonly size: {width: number; height: number};\n readonly title: {name: string; show: boolean; position: TitlePosition};\n readonly yAxis: ScatterplotAxisSettings;\n readonly xAxis: ScatterplotAxisSettings;\n readonly frame: {type: FrameType};\n readonly legend: {show: boolean; position: LegendPosition};\n readonly tooltips: {show: boolean; content?: ColumnName[]};\n };\n readonly inheritedAes: Record<string, AesRecord>;\n readonly layers: ScatterplotUmapLayer[];\n\n constructor(settings: ScatterplotUmapSettings) {\n ScatterplotUmapSettingsSchema.parse(settings);\n this.id = lodash.uniqueId('settings');\n this.keyColumn = settings.keyColumn ?? null;\n this.x = settings.x;\n this.y = settings.y;\n this.grouping = settings.grouping ?? [];\n this.label = settings.label ?? null;\n this.highlight = settings.highlight ?? null;\n this.chartSettings = {\n size: {\n width: settings?.size?.width ?? DEFAULT_WIDTH,\n height: settings?.size?.height ?? DEFAULT_HEIGHT,\n },\n title: {\n position: 'center',\n show: true,\n ...settings.title,\n name: settings.title?.name ?? 'Chart',\n },\n yAxis: {\n title: settings.y.label ?? settings.y.value,\n scale: 'linear',\n showGrid: true,\n showTicks: true,\n ...settings.yAxis,\n },\n xAxis: {\n title: settings.x.label ?? settings.x.value,\n scale: 'linear',\n showGrid: true,\n showTicks: true,\n ...settings.xAxis,\n },\n frame: {type: settings.frame?.type ?? 'full'},\n legend: {\n show: true,\n position: 'right',\n ...settings.legend,\n },\n tooltips: {\n show: true,\n ...settings.tooltips,\n },\n };\n\n this.inheritedAes = settings.inheritedAes ?? {};\n\n this.layers = settings.layers\n .map(layer => {\n if (layer.type === 'dots') {\n return new DotsLayer(layer);\n } else if (layer.type === 'curve') {\n return new CurveLayer(layer);\n } else {\n throw new Error('Unknown layer type');\n }\n })\n .filter(Boolean) as ScatterplotUmapLayer[];\n }\n}\n"],"names":["DotsLayer","layer","__publicField","BLACK","CurveLayer","ScatterplotUmapSettingsImpl","settings","ScatterplotUmapSettingsSchema","lodash","_a","DEFAULT_WIDTH","_b","DEFAULT_HEIGHT","_c","_d"],"mappings":";;;;;;AAoBO,MAAMA,EAAU;AAAA,EAanB,YAAYC,GAAuB;AAZ1B,IAAAC,EAAA,cAAO;AACP,IAAAA,EAAA,aAKL;AAAA,MACA,SAASC;AAAA,MACT,UAAU;AAAA,MACV,SAAS;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EAAS;AAAA,QACZ,QAAMO,IAAAP,EAAS,UAAT,gBAAAO,EAAgB,SAAQ;AAAA,MAAA;AAAA,MAElC,OAAO;AAAA,QACH,OAAOP,EAAS,EAAE,SAASA,EAAS,EAAE;AAAA,QACtC,OAAO;AAAA,QACP,UAAU;AAAA,QACV,WAAW;AAAA,QACX,GAAGA,EAAS;AAAA,MAAA;AAAA,MAEhB,OAAO;AAAA,QACH,OAAOA,EAAS,EAAE,SAASA,EAAS,EAAE;AAAA,QACtC,OAAO;AAAA,QACP,UAAU;AAAA,QACV,WAAW;AAAA,QACX,GAAGA,EAAS;AAAA,MAAA;AAAA,MAEhB,OAAO,EAAC,QAAMQ,IAAAR,EAAS,UAAT,gBAAAQ,EAAgB,SAAQ,OAAA;AAAA,MACtC,QAAQ;AAAA,QACJ,MAAM;AAAA,QACN,UAAU;AAAA,QACV,GAAGR,EAAS;AAAA,MAAA;AAAA,MAEhB,UAAU;AAAA,QACN,MAAM;AAAA,QACN,GAAGA,EAAS;AAAA,MAAA;AAAA,IAChB,GAGJ,KAAK,eAAeA,EAAS,gBAAgB,CAAA,GAE7C,KAAK,SAASA,EAAS,OAClB,IAAI,CAAAL,MAAS;AACV,UAAIA,EAAM,SAAS;AACf,eAAO,IAAID,EAAUC,CAAK;AAC9B,UAAWA,EAAM,SAAS;AACtB,eAAO,IAAIG,EAAWH,CAAK;AAE3B,YAAM,IAAI,MAAM,oBAAoB;AAAA,IAE5C,CAAC,EACA,OAAO,OAAO;AAAA,EACvB;AACJ;"}
1
+ {"version":3,"file":"SettingsImpl.js","sources":["../../src/scatterplot-umap/SettingsImpl.ts"],"sourcesContent":["import lodash from 'lodash';\nimport { BLACK, DEFAULT_HEIGHT, DEFAULT_WIDTH } from '../constants';\nimport type { ScatterplotAxisSettings } from '../scatterplot/ScatterplotSettingsImpl';\nimport type {\n ColumnName,\n ContinuousAesFromColumn,\n DataValue,\n FrameType,\n LegendPosition,\n LineShape,\n SettingsInterface,\n TitlePosition\n} from '../types';\nimport {type AesRecord, type InheritAesScatterplot, type PointShape} from '../types';\nimport type {\n CurveUmapLayer as OuterCurveLayer,\n DotsUmapLayer as OuterDotsLayer,\n ScatterplotUmapSettings\n} from '../types/scatterplot-umap';\nimport { ScatterplotUmapSettingsSchema } from '../types/scatterplot-umap';\n\nexport class DotsLayer {\n readonly type = 'dots';\n readonly aes: {\n dotFill: string | InheritAesScatterplot | ContinuousAesFromColumn<string>;\n dotShape: PointShape | InheritAesScatterplot;\n dotSize: number | ContinuousAesFromColumn<number>;\n opacity: number;\n } = {\n dotFill: BLACK,\n dotShape: '21',\n dotSize: 3,\n opacity: 1,\n };\n constructor(layer: OuterDotsLayer) {\n this.aes = {\n ...this.aes,\n ...layer.aes,\n };\n }\n}\nexport class CurveLayer {\n readonly type = 'curve';\n readonly smoothing: boolean;\n readonly aes: {\n lineColor: string | InheritAesScatterplot | ContinuousAesFromColumn<string>;\n lineWidth: number;\n lineShape: LineShape;\n opacity: number;\n } = {\n lineColor: BLACK,\n lineWidth: 1,\n lineShape: 'solid',\n opacity: 1,\n };\n\n constructor(layer: OuterCurveLayer) {\n this.smoothing = layer.smoothing ?? false;\n this.aes = {\n ...this.aes,\n ...layer.aes,\n };\n }\n}\n\nexport type ScatterplotUmapLayer = DotsLayer | CurveLayer;\n\nexport class ScatterplotUmapSettingsImpl implements SettingsInterface {\n readonly id: string;\n readonly type = 'scatterplot-umap';\n readonly keyColumn: ColumnName | null;\n readonly x: ColumnName;\n readonly y: ColumnName;\n readonly grouping: {\n columnName: ColumnName;\n order?: DataValue[];\n inheritedAes?: AesRecord;\n }[];\n readonly label: ColumnName | null;\n readonly highlight: ColumnName | null;\n readonly chartSettings: {\n readonly size: {width: number; height: number};\n readonly title: {name: string; show: boolean; position: TitlePosition};\n readonly yAxis: ScatterplotAxisSettings;\n readonly xAxis: ScatterplotAxisSettings;\n readonly frame: {type: FrameType};\n readonly legend: {show: boolean; position: LegendPosition};\n readonly tooltips: {show: boolean; content?: ColumnName[]};\n };\n readonly layers: ScatterplotUmapLayer[];\n\n constructor(settings: ScatterplotUmapSettings) {\n ScatterplotUmapSettingsSchema.parse(settings);\n this.id = lodash.uniqueId('settings');\n this.keyColumn = settings.keyColumn ?? null;\n this.x = settings.x;\n this.y = settings.y;\n this.grouping = settings.grouping ?? [];\n this.label = settings.label ?? null;\n this.highlight = settings.highlight ?? null;\n this.chartSettings = {\n size: {\n width: settings?.size?.width ?? DEFAULT_WIDTH,\n height: settings?.size?.height ?? DEFAULT_HEIGHT,\n },\n title: {\n position: 'center',\n show: true,\n ...settings.title,\n name: settings.title?.name ?? 'Chart',\n },\n yAxis: {\n title: settings.y.label ?? settings.y.value,\n scale: 'linear',\n showGrid: true,\n showTicks: true,\n ...settings.yAxis,\n },\n xAxis: {\n title: settings.x.label ?? settings.x.value,\n scale: 'linear',\n showGrid: true,\n showTicks: true,\n ...settings.xAxis,\n },\n frame: {type: settings.frame?.type ?? 'full'},\n legend: {\n show: true,\n position: 'right',\n ...settings.legend,\n },\n tooltips: {\n ...settings.tooltips,\n show: !(settings.tooltips?.show === false) && (settings.tooltips?.content ?? []).length > 0,\n },\n };\n\n this.layers = settings.layers\n .map(layer => {\n if (layer.type === 'dots') {\n return new DotsLayer(layer);\n } else if (layer.type === 'curve') {\n return new CurveLayer(layer);\n } else {\n throw new Error('Unknown layer type');\n }\n })\n .filter(Boolean) as ScatterplotUmapLayer[];\n }\n}\n"],"names":["DotsLayer","layer","__publicField","BLACK","CurveLayer","ScatterplotUmapSettingsImpl","settings","ScatterplotUmapSettingsSchema","lodash","_a","DEFAULT_WIDTH","_b","DEFAULT_HEIGHT","_c","_d","_e","_f"],"mappings":";;;;;;AAqBO,MAAMA,EAAU;AAAA,EAanB,YAAYC,GAAuB;AAZ1B,IAAAC,EAAA,cAAO;AACP,IAAAA,EAAA,aAKL;AAAA,MACA,SAASC;AAAA,MACT,UAAU;AAAA,MACV,SAAS;AAAA,MACT,SAAS;AAAA,IAAA;AAGT,SAAK,MAAM;A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CAAC;AAEzD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAMrD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAG9C,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,iBAAiB,CAAC;AACnE,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,UAAU,EAAE,GAAG,EAAE,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAoB7G,iBAAS,QAAQ,CAAC,EACd,MAAM,EACN,aAAa,EACb,SAAS,EACT,SAAS,EACT,OAAO,EACP,UAAU,EACV,SAAS,EACT,YAAY,EACZ,UAAU,EACV,cAAc,EACd,MAAM,EACN,UAAU,EACV,WAAW,EACd,EAAE;IACC,UAAU,EAAE,aAAa,CAAC,YAAY,CAAC,CAAC;IACxC,MAAM,EAAE,WAAW,CAAC;IACpB,aAAa,EAAE,2BAA2B,CAAC,eAAe,CAAC,CAAC;IAC5D,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,SAAS,EAAE,UAAU,GAAG,IAAI,CAAC;IAC7B,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,UAAU,CAAC;IACvB,aAAa,EAAE,aAAa,CAAC;IAC7B,WAAW,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IAC7B,SAAS,EAAE,UAAU,GAAG,IAAI,CAAC;IAC7B,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,UAAU,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC;IACtC,MAAM,EAAE,2BAA2B,CAAC,QAAQ,CAAC,CAAC;IAC9C,WAAW,EAAE,YAAY,CAAC,OAAO,CAAC,CAAC;CACtC,kDAgKA;;AAED,wBAAoC"}
@@ -1,45 +1,47 @@
1
- import { j as i } from "../../node_modules/react/jsx-runtime.js";
2
- import O, { r as g } from "../../_virtual/index.js";
3
- import { ChartsTitle as R } from "../../common/ChartsTitle.js";
4
- import { ContinuousGrid as V } from "../../common/ContinuousGrid.js";
1
+ import { j as o } from "../../node_modules/react/jsx-runtime.js";
2
+ import N, { r as g } from "../../_virtual/index.js";
3
+ import { ChartsTitle as O } from "../../common/ChartsTitle.js";
4
+ import { ContinuousGrid as R } from "../../common/ContinuousGrid.js";
5
5
  import M from "../../common/fonts.js";
6
6
  import { Legend as U } from "../../common/Legend.js";
7
- import { Tooltip as Z } from "../../common/Tooltip.js";
8
- import { useDataFrame as q } from "../../common/useDataFrame.js";
9
- import { BLACK as G } from "../../constants.js";
10
- import { Axis as H } from "../../scatterplot/components/Axis.js";
11
- import { numberFormat as L } from "../../utils/numberFormat.js";
12
- import { DEFAULT_TICKS_SIZE as F, TITLE_LINE as u, LEGEND_OFFSET as J } from "../constants.js";
7
+ import { Tooltip as V } from "../../common/Tooltip.js";
8
+ import { useDataFrame as Z } from "../../common/useDataFrame.js";
9
+ import { BLACK as q } from "../../constants.js";
10
+ import { Axis as E } from "../../scatterplot/components/Axis.js";
11
+ import { formatColumnValue as G } from "../../scatterplot/utils/formatColumnValue.js";
12
+ import { DEFAULT_TICKS_SIZE as H, TITLE_LINE as u, LEGEND_OFFSET as J } from "../constants.js";
13
13
  import Q from "../../node_modules/d3-shape/src/line.js";
14
14
  import S from "../../node_modules/d3-shape/src/curve/basis.js";
15
- function z(e, s, h, c = []) {
16
- const n = [`x: ${L(s.x)}`, `y: ${L(s.y)}`];
17
- h != null && h.label && n.unshift(`${h.label}: ${e.getColumnValue(h.label, s.idx)}`);
18
- for (const t of c)
19
- n.push(`${t.label}: ${e.getColumnValue(t.valueLabels ?? t.value, s.idx)}`);
20
- return n;
15
+ import { format as z } from "../../node_modules/d3-format/src/defaultLocale.js";
16
+ function tt(i, d, m = []) {
17
+ const a = [];
18
+ for (const e of m) {
19
+ const t = e != null && e.format ? z(e.format) : void 0;
20
+ a.push(`${e.label}: ${G(i, d.idx, e, t)}`);
21
+ }
22
+ return a;
21
23
  }
22
- function P(e) {
23
- return typeof e == "string" ? e : e.label ?? e.value;
24
+ function F(i) {
25
+ return typeof i == "string" ? i : i.label ?? i.value;
24
26
  }
25
- const k = Q().curve(S);
26
- function tt({
27
- scales: e,
28
- chartSettings: s,
29
- mainTitle: h,
30
- keyColumn: c,
31
- margins: n,
27
+ const L = Q().curve(S);
28
+ function ot({
29
+ scales: i,
30
+ chartSettings: d,
31
+ mainTitle: m,
32
+ keyColumn: a,
33
+ margins: e,
32
34
  chartSizes: t,
33
35
  container: j,
34
36
  zoomStateKey: y,
35
- legendData: A,
36
- dotsByGrouping: C,
37
- layers: D,
38
- aesGetters: a,
39
- tooltipData: d
37
+ legendData: P,
38
+ dotsByGrouping: b,
39
+ layers: A,
40
+ aesGetters: x,
41
+ tooltipData: h
40
42
  }) {
41
- var E;
42
- const B = q(), { title: w, xAxis: p, yAxis: m, frame: I, legend: _ } = s, X = p.showTicks ? F : 0, Y = m.showTicks ? F : 0, $ = p.title, T = m.title, K = {
43
+ var v;
44
+ const D = Z(), { title: w, xAxis: p, yAxis: c, frame: B, legend: I } = d, _ = p.showTicks ? H : 0, X = c.showTicks ? H : 0, T = p.title, W = c.title, Y = {
43
45
  left: 0,
44
46
  right: t.chartWidth,
45
47
  top: 0,
@@ -47,20 +49,20 @@ function tt({
47
49
  };
48
50
  if (!j)
49
51
  return null;
50
- const o = D.find((r) => r.type === "curve"), [W, N] = g.useState([]);
51
- function v() {
52
- const f = Object.entries(C).map(([x, l]) => ({
53
- key: x,
54
- d: o != null && o.smoothing ? k(l) ?? "" : l.map((b) => `${e.x(b.x)},${e.y(b.y)}`).join(" "),
52
+ const n = A.find((r) => r.type === "curve"), [k, K] = g.useState([]);
53
+ function $() {
54
+ const f = Object.entries(b).map(([s, l]) => ({
55
+ key: s,
56
+ d: n != null && n.smoothing ? L(l) ?? "" : l.map((C) => `${i.x(C.x)},${i.y(C.y)}`).join(" "),
55
57
  dot: l[0]
56
58
  }));
57
- N(f);
59
+ K(f);
58
60
  }
59
61
  return g.useEffect(() => {
60
- o && (k.x((r) => e.x(r.x)).y((r) => e.y(r.y)), v());
62
+ n && (L.x((r) => i.x(r.x)).y((r) => i.y(r.y)), $());
61
63
  }, [y, t.chartWidth, t.chartHeight]), g.useEffect(() => {
62
- o && v();
63
- }, [o == null ? void 0 : o.smoothing]), /* @__PURE__ */ i.jsxs(
64
+ n && $();
65
+ }, [n == null ? void 0 : n.smoothing]), /* @__PURE__ */ o.jsxs(
64
66
  "svg",
65
67
  {
66
68
  xmlns: "http://www.w3.org/2000/svg",
@@ -69,103 +71,103 @@ function tt({
69
71
  height: t.totalHeight,
70
72
  style: { pointerEvents: "none" },
71
73
  children: [
72
- /* @__PURE__ */ i.jsx("defs", { children: M }),
73
- /* @__PURE__ */ i.jsxs("g", { transform: `translate(${n.left},${n.top})`, fontFamily: "Manrope", children: [
74
- /* @__PURE__ */ i.jsx("clipPath", { id: "viewportClipPath", children: /* @__PURE__ */ i.jsx("rect", { x: "0", y: "0", width: t.chartWidth, height: t.chartHeight }) }),
75
- /* @__PURE__ */ i.jsx(
76
- R,
74
+ /* @__PURE__ */ o.jsx("defs", { children: M }),
75
+ /* @__PURE__ */ o.jsxs("g", { transform: `translate(${e.left},${e.top})`, fontFamily: "Manrope", children: [
76
+ /* @__PURE__ */ o.jsx("clipPath", { id: "viewportClipPath", children: /* @__PURE__ */ o.jsx("rect", { x: "0", y: "0", width: t.chartWidth, height: t.chartHeight }) }),
77
+ /* @__PURE__ */ o.jsx(
78
+ O,
77
79
  {
78
- title: h,
80
+ title: m,
79
81
  show: w.show,
80
82
  position: w.position,
81
- leftPadding: n.left,
82
- rightPadding: n.right,
83
+ leftPadding: e.left,
84
+ rightPadding: e.right,
83
85
  chartsWidth: t.chartWidth
84
86
  }
85
87
  ),
86
- /* @__PURE__ */ i.jsxs("g", { dominantBaseline: "central", textAnchor: "middle", fontWeight: "500", fontSize: "14px", fill: G, children: [
87
- $ && /* @__PURE__ */ i.jsx(
88
+ /* @__PURE__ */ o.jsxs("g", { dominantBaseline: "central", textAnchor: "middle", fontWeight: "500", fontSize: "14px", fill: q, children: [
89
+ T && /* @__PURE__ */ o.jsx(
88
90
  "text",
89
91
  {
90
92
  x: t.chartWidth / 2,
91
- y: t.chartHeight + n.bottom - u / 2,
92
- children: P($)
93
+ y: t.chartHeight + e.bottom - u / 2,
94
+ children: F(T)
93
95
  }
94
96
  ),
95
- T && /* @__PURE__ */ i.jsx(
97
+ W && /* @__PURE__ */ o.jsx(
96
98
  "text",
97
99
  {
98
- x: -n.left + u / 2,
100
+ x: -e.left + u / 2,
99
101
  y: t.chartHeight / 2,
100
- transform: `rotate(-90,${-n.left + u / 2},${t.chartHeight / 2})`,
101
- children: P(T)
102
+ transform: `rotate(-90,${-e.left + u / 2},${t.chartHeight / 2})`,
103
+ children: F(W)
102
104
  }
103
105
  )
104
106
  ] }),
105
- /* @__PURE__ */ i.jsx(
106
- V,
107
+ /* @__PURE__ */ o.jsx(
108
+ R,
107
109
  {
108
110
  width: t.chartWidth,
109
111
  height: t.chartHeight,
110
- scaleX: e.x,
111
- scaleY: e.y,
112
+ scaleX: i.x,
113
+ scaleY: i.y,
112
114
  axisX: p,
113
- axisY: m,
115
+ axisY: c,
114
116
  updatingKey: y,
115
- frameType: I.type
117
+ frameType: B.type
116
118
  }
117
119
  ),
118
- /* @__PURE__ */ i.jsx("g", { transform: `translate(0,${t.chartHeight})`, children: /* @__PURE__ */ i.jsx(H, { scale: e.x, orient: "bottom", tickSize: X }) }),
119
- /* @__PURE__ */ i.jsx("g", { children: /* @__PURE__ */ i.jsx(H, { scale: e.y, orient: "left", tickSize: Y }) }),
120
- o && o.smoothing && /* @__PURE__ */ i.jsx("g", { clipPath: "url(#viewportClipPath)", children: W.map(({ key: r, d: f, dot: x }) => {
120
+ /* @__PURE__ */ o.jsx("g", { transform: `translate(0,${t.chartHeight})`, children: /* @__PURE__ */ o.jsx(E, { scale: i.x, orient: "bottom", tickSize: _ }) }),
121
+ /* @__PURE__ */ o.jsx("g", { children: /* @__PURE__ */ o.jsx(E, { scale: i.y, orient: "left", tickSize: X }) }),
122
+ n && n.smoothing && /* @__PURE__ */ o.jsx("g", { clipPath: "url(#viewportClipPath)", children: k.map(({ key: r, d: f, dot: s }) => {
121
123
  var l;
122
- return /* @__PURE__ */ i.jsx(
124
+ return /* @__PURE__ */ o.jsx(
123
125
  "path",
124
126
  {
125
127
  d: f,
126
128
  fill: "none",
127
- stroke: a.dotFill(x.idx),
128
- strokeWidth: (l = o.aes) == null ? void 0 : l.lineWidth,
129
- strokeDasharray: a.lineType(x.idx)
129
+ stroke: x.dotFill(s.idx),
130
+ strokeWidth: (l = n.aes) == null ? void 0 : l.lineWidth,
131
+ strokeDasharray: x.lineType(s.idx)
130
132
  },
131
133
  r
132
134
  );
133
135
  }) }),
134
- o && !o.smoothing && /* @__PURE__ */ i.jsx("g", { clipPath: "url(#viewportClipPath)", children: W.map(({ key: r, d: f, dot: x }) => {
136
+ n && !n.smoothing && /* @__PURE__ */ o.jsx("g", { clipPath: "url(#viewportClipPath)", children: k.map(({ key: r, d: f, dot: s }) => {
135
137
  var l;
136
- return /* @__PURE__ */ i.jsx(
138
+ return /* @__PURE__ */ o.jsx(
137
139
  "polyline",
138
140
  {
139
141
  points: f,
140
142
  fill: "none",
141
- stroke: a.dotFill(x.idx),
142
- strokeWidth: (l = o.aes) == null ? void 0 : l.lineWidth,
143
- strokeDasharray: a.lineType(x.idx)
143
+ stroke: x.dotFill(s.idx),
144
+ strokeWidth: (l = n.aes) == null ? void 0 : l.lineWidth,
145
+ strokeDasharray: x.lineType(s.idx)
144
146
  },
145
147
  r
146
148
  );
147
149
  }) }),
148
- d.selectedData && /* @__PURE__ */ i.jsx(
149
- Z,
150
+ d.tooltips.show && h.selectedData && /* @__PURE__ */ o.jsx(
151
+ V,
150
152
  {
151
- content: z(B, d.selectedData, c, (E = s.tooltips) == null ? void 0 : E.content),
152
- x: e.x(d.selectedData.x),
153
- y: e.y(d.selectedData.y),
153
+ content: tt(D, h.selectedData, (v = d.tooltips) == null ? void 0 : v.content),
154
+ x: i.x(h.selectedData.x),
155
+ y: i.y(h.selectedData.y),
154
156
  active: !0,
155
- fixed: d.fixed,
156
- sideDistances: K,
157
+ fixed: h.fixed,
158
+ sideDistances: Y,
157
159
  container: j,
158
- onClose: d.onClose
160
+ onClose: h.onClose
159
161
  }
160
162
  ),
161
- _.show && /* @__PURE__ */ i.jsx("g", { transform: `translate(${t.chartWidth + J},0)`, children: /* @__PURE__ */ i.jsx(U, { legendData: A }) })
163
+ I.show && /* @__PURE__ */ o.jsx("g", { transform: `translate(${t.chartWidth + J},0)`, children: /* @__PURE__ */ o.jsx(U, { legendData: P }) })
162
164
  ] })
163
165
  ]
164
166
  }
165
167
  );
166
168
  }
167
- const mt = O.memo(tt);
169
+ const ut = N.memo(ot);
168
170
  export {
169
- mt as default
171
+ ut as default
170
172
  };
171
173
  //# sourceMappingURL=LowerSVG.js.map