@pixerate/editor 0.48.0 → 0.49.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/dist/agent/index.cjs +24 -22
- package/dist/agent/index.cjs.map +1 -1
- package/dist/agent/index.js +6 -4
- package/dist/agent/index.js.map +1 -1
- package/dist/chart/index.cjs +81 -79
- package/dist/chart/index.cjs.map +1 -1
- package/dist/chart/index.js +52 -50
- package/dist/chart/index.js.map +1 -1
- package/dist/{chunk-TXXNBDQX.cjs → chunk-2Q46FKZK.cjs} +113 -34
- package/dist/chunk-2Q46FKZK.cjs.map +1 -0
- package/dist/{chunk-PIMCHMZE.cjs → chunk-3JNRQVTS.cjs} +16 -16
- package/dist/{chunk-PIMCHMZE.cjs.map → chunk-3JNRQVTS.cjs.map} +1 -1
- package/dist/{chunk-HXUL3LS7.js → chunk-5TWIN7ZJ.js} +2 -2
- package/dist/{chunk-VKPEPWKZ.js → chunk-DQPBQXKG.js} +4 -4
- package/dist/{chunk-MUCYWI6W.cjs → chunk-FEMIVHN3.cjs} +17 -15
- package/dist/chunk-FEMIVHN3.cjs.map +1 -0
- package/dist/{chunk-XUUD43OV.js → chunk-GJBIVWB2.js} +2 -2
- package/dist/{chunk-PRSJJZBS.cjs → chunk-GTZXF4BI.cjs} +191 -841
- package/dist/chunk-GTZXF4BI.cjs.map +1 -0
- package/dist/chunk-JOX6MJW4.cjs +674 -0
- package/dist/chunk-JOX6MJW4.cjs.map +1 -0
- package/dist/{chunk-WXEHCVJQ.cjs → chunk-LNKZPIQD.cjs} +52 -52
- package/dist/{chunk-WXEHCVJQ.cjs.map → chunk-LNKZPIQD.cjs.map} +1 -1
- package/dist/chunk-OV7UAKIY.js +674 -0
- package/dist/chunk-OV7UAKIY.js.map +1 -0
- package/dist/{chunk-PKBWLEL7.js → chunk-QFTVLEVN.js} +6 -4
- package/dist/{chunk-PKBWLEL7.js.map → chunk-QFTVLEVN.js.map} +1 -1
- package/dist/{chunk-KRGXUQ2Y.js → chunk-T6XU4B54.js} +82 -3
- package/dist/chunk-T6XU4B54.js.map +1 -0
- package/dist/{chunk-U6IZKC7B.cjs → chunk-TGBCBQFV.cjs} +14 -14
- package/dist/{chunk-U6IZKC7B.cjs.map → chunk-TGBCBQFV.cjs.map} +1 -1
- package/dist/{chunk-LTUM52X6.js → chunk-WBOAXDKD.js} +109 -759
- package/dist/chunk-WBOAXDKD.js.map +1 -0
- package/dist/export/index.cjs +4 -2
- package/dist/export/index.cjs.map +1 -1
- package/dist/export/index.d.cts +5 -1
- package/dist/export/index.d.ts +5 -1
- package/dist/export/index.js +3 -1
- package/dist/extensions/index.cjs +6 -5
- package/dist/extensions/index.cjs.map +1 -1
- package/dist/extensions/index.js +5 -4
- package/dist/index.cjs +12 -11
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +6 -5
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-KRGXUQ2Y.js.map +0 -1
- package/dist/chunk-LTUM52X6.js.map +0 -1
- package/dist/chunk-MUCYWI6W.cjs.map +0 -1
- package/dist/chunk-PRSJJZBS.cjs.map +0 -1
- package/dist/chunk-TXXNBDQX.cjs.map +0 -1
- /package/dist/{chunk-HXUL3LS7.js.map → chunk-5TWIN7ZJ.js.map} +0 -0
- /package/dist/{chunk-VKPEPWKZ.js.map → chunk-DQPBQXKG.js.map} +0 -0
- /package/dist/{chunk-XUUD43OV.js.map → chunk-GJBIVWB2.js.map} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/editor/editor/packages/core/dist/chunk-PIMCHMZE.cjs","../src/chart/ooxml.ts"],"names":["rich"],"mappings":"AAAA;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACF,wDAA6B;AAC7B;AACA;ACDO,IAAM,eAAA,EAAiB,wDAAA;AACvB,IAAM,yBAAA,EAA2B,mEAAA;AACjC,IAAM,yBAAA,EAA2B,2EAAA;AAsBxC,IAAM,WAAA,EAA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ACkC,EAAA;AACtC,EAAA;AACU,IAAA;AACkB,IAAA;AAC1D,EAAA;AACwC,EAAA;AACN,EAAA;AACA,EAAA;AAC8D,EAAA;AAGzF,EAAA;AACI,EAAA;AACG,EAAA;AAC2C,IAAA;AACF,IAAA;AACC,IAAA;AACxD,EAAA;AACsD,EAAA;AACpB,EAAA;AACwB,EAAA;AAC3B,EAAA;AACqB,EAAA;AAEnD,EAAA;AAI0C,EAAA;AAC5C;ADvE6D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"/home/runner/work/editor/editor/packages/core/dist/chunk-PIMCHMZE.cjs","sourcesContent":[null,"// The DrawingML chart reader follows deckcraft-main/crates/pptx/src/read/chart.rs (group → type mapping,\n// secondary-axis detection by axis id and position, cache / literal data, number-format precedence) and the\n// chartex reader gridcraft-main/crates/xlsx/src/chartex.rs; the \"editable only when it regenerates\" idea is\n// from wordcraft-main/crates/docx/src/chart_spec.rs (MIT OR Apache-2.0, © ArtCraft Team and contributors).\n// See THIRD_PARTY_NOTICES.md.\nimport { parseChartColor, chartRgbToHex } from './color.js';\nimport { chartFamily, chartSeriesType, defaultChartAxis, isCartesianChart, normalizeChartSpec } from './spec.js';\nimport type { ChartAxis, ChartIssue, ChartLegendPosition, ChartMarker, ChartNumberFormat, ChartSeries, ChartSpec, ChartTrendline, ChartTrendlineType, ChartType, ChartValue } from './types.js';\n\nexport const CHART_OOXML_NS = 'http://schemas.openxmlformats.org/drawingml/2006/chart';\nexport const CHART_OOXML_CONTENT_TYPE = 'application/vnd.openxmlformats-officedocument.drawingml.chart+xml';\nexport const CHART_OOXML_RELATIONSHIP = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/chart';\n\ntype ParserCtor = { new (): DOMParser };\n\nexport interface ChartOoxmlReadOptions {\n\t/** `DOMParser` constructor (default: the global one; pass jsdom's or xmldom's in Node). */\n\tDOMParser?: ParserCtor;\n}\n\nexport interface ChartOoxmlReadResult {\n\tspec: ChartSpec;\n\t/** Problems and simplifications, as sentences. */\n\tissues: ChartIssue[];\n\t/** Features the file uses that the spec cannot hold (3-D, stock, surface, gradients, …). */\n\tunsupported: string[];\n\t/**\n\t * Nothing was dropped: writing `spec` back gives an equivalent chart. When false, keep the\n\t * original part (or show the chart read-only) if the file must stay as it was.\n\t */\n\tlossless: boolean;\n}\n\nconst MAX_POINTS = 100_000;\n\nfunction parser(options: ChartOoxmlReadOptions): ParserCtor {\n\tconst P = options.DOMParser ?? (globalThis as { DOMParser?: ParserCtor }).DOMParser;\n\tif (!P) throw new Error('Reading chart XML needs a DOMParser. In Node, pass one (e.g. from jsdom or @xmldom/xmldom) as { DOMParser }.');\n\treturn P;\n}\n\nconst kids = (el: Element | null | undefined, name?: string): Element[] => (el ? Array.from(el.childNodes).filter((n): n is Element => n.nodeType === 1 && (!name || (n as Element).localName === name)) : []);\nconst kid = (el: Element | null | undefined, name: string) => kids(el, name)[0];\nconst val = (el: Element | null | undefined, name: string) => kid(el, name)?.getAttribute('val') ?? undefined;\nconst path = (el: Element | null | undefined, ...names: string[]) => names.reduce<Element | undefined>((e, n) => kid(e, n), el ?? undefined);\nconst find = (el: Element | null | undefined, name: string): Element | undefined => {\n\tif (!el) return undefined;\n\tfor (const c of kids(el)) {\n\t\tif (c.localName === name) return c;\n\t\tconst deep = find(c, name);\n\t\tif (deep) return deep;\n\t}\n\treturn undefined;\n};\nconst bool = (v: string | undefined, fallback = false) => (v === undefined ? fallback : v === '1' || v === 'true');\nconst numberOf = (v: string | undefined) => {\n\tif (v === undefined) return null;\n\tconst n = Number(v);\n\treturn Number.isFinite(n) ? n : null;\n};\n\nfunction strings(e: Element | undefined): string[] {\n\tif (!e) return [];\n\tconst cache = find(e, 'strCache') ?? find(e, 'numCache') ?? find(e, 'strLit') ?? find(e, 'numLit');\n\tif (cache) {\n\t\tconst n = Math.min(MAX_POINTS, Number(val(cache, 'ptCount') ?? 0) || 0);\n\t\tconst out: string[] = Array(n).fill('');\n\t\tfor (const pt of kids(cache, 'pt').slice(0, MAX_POINTS)) {\n\t\t\tconst i = Number(pt.getAttribute('idx') ?? 0);\n\t\t\tif (!Number.isInteger(i) || i < 0 || i >= MAX_POINTS) continue;\n\t\t\twhile (out.length <= i) out.push('');\n\t\t\tout[i] = kid(pt, 'v')?.textContent ?? '';\n\t\t}\n\t\treturn out;\n\t}\n\tconst multi = find(e, 'multiLvlStrCache');\n\tif (multi) {\n\t\tconst lvl = kid(multi, 'lvl');\n\t\treturn kids(lvl, 'pt').map((p) => kid(p, 'v')?.textContent ?? '');\n\t}\n\tconst v = kid(e, 'v') ?? find(e, 'v');\n\treturn v ? [v.textContent ?? ''] : [];\n}\n\nconst numbers = (e: Element | undefined): ChartValue[] => strings(e).map((s) => (s.trim() === '' ? null : numberOf(s.trim())));\n\nfunction formatCodeOf(e: Element | undefined): string | undefined {\n\treturn find(e, 'numCache') ? (kid(find(e, 'numCache'), 'formatCode')?.textContent ?? undefined) : undefined;\n}\n\nfunction richText(t: Element | undefined): string | undefined {\n\tif (!t) return undefined;\n\tconst tx = kid(t, 'tx');\n\tconst rich = kid(tx, 'rich');\n\tif (rich) return kids(rich, 'p').map((p) => Array.from(p.getElementsByTagNameNS('*', 't')).map((x) => x.textContent ?? '').join('')).join('\\n');\n\tconst v = find(tx, 'v');\n\treturn v?.textContent ?? undefined;\n}\n\nfunction solidColor(spPr: Element | undefined): string | undefined {\n\tconst fill = kid(spPr, 'solidFill') ?? kid(kid(spPr, 'ln'), 'solidFill');\n\tconst srgb = kid(fill, 'srgbClr');\n\tconst v = srgb?.getAttribute('val');\n\treturn v && /^[0-9a-f]{6}$/i.test(v) ? `#${v.toLowerCase()}` : undefined;\n}\n\nconst MARKERS: Record<string, ChartMarker> = { circle: 'circle', dot: 'circle', square: 'square', diamond: 'diamond', triangle: 'triangle', x: 'cross', plus: 'cross', star: 'cross', dash: 'square', none: 'none' };\nconst TREND_IN: Record<string, ChartTrendlineType> = { linear: 'linear', exp: 'exponential', log: 'logarithmic', poly: 'polynomial', power: 'power', movingAvg: 'moving-average' };\nconst TREND_OUT: Record<ChartTrendlineType, string> = { linear: 'linear', exponential: 'exp', logarithmic: 'log', polynomial: 'poly', power: 'power', 'moving-average': 'movingAvg' };\nconst LEGEND_IN: Record<string, ChartLegendPosition> = { b: 'bottom', t: 'top', l: 'left', r: 'right', tr: 'right' };\n\n/**\n * Reads a DrawingML chart part (`c:chartSpace`, e.g. `word/charts/chart1.xml`) or an Office\n * 2016 chartex part (`cx:chartSpace`: waterfall, funnel, treemap, histogram, box & whisker)\n * as a chart spec. Data comes from the cached values. Never throws for a malformed chart: it\n * returns an empty chart and says why.\n */\nexport function chartFromOoxml(xml: string, options: ChartOoxmlReadOptions = {}): ChartOoxmlReadResult {\n\tconst issues: ChartIssue[] = [];\n\tconst unsupported: string[] = [];\n\tlet doc: Document;\n\ttry {\n\t\tdoc = new (parser(options))().parseFromString(xml, 'application/xml');\n\t} catch (error) {\n\t\treturn { spec: normalizeChartSpec({}).spec, issues: [{ path: '', message: `The chart XML could not be read: ${(error as Error).message}` }], unsupported, lossless: false };\n\t}\n\tconst root = doc.documentElement;\n\tif (!root || root.localName !== 'chartSpace' || doc.getElementsByTagName('parsererror').length) {\n\t\treturn { spec: normalizeChartSpec({}).spec, issues: [{ path: '', message: 'This is not a chart part: expected a c:chartSpace (or cx:chartSpace) root element.' }], unsupported, lossless: false };\n\t}\n\tif (root.namespaceURI?.includes('chartex') || kid(root, 'chartData')) return readChartex(root, issues, unsupported);\n\n\tconst chart = kid(root, 'chart');\n\tconst plot = kid(chart, 'plotArea');\n\tconst input: Record<string, unknown> = { type: 'bar' };\n\tconst titleEl = kid(chart, 'title');\n\tif (titleEl && !bool(val(chart, 'autoTitleDeleted'))) input.title = richText(titleEl) ?? '';\n\tconst legend = kid(chart, 'legend');\n\tinput.legend = { show: !!legend, position: LEGEND_IN[val(legend, 'legendPos') ?? 'r'] ?? 'right' };\n\tif (kid(root, 'roundedCorners') && bool(val(root, 'roundedCorners'))) unsupported.push('rounded corners');\n\n\tconst valAxes = kids(plot, 'valAx');\n\tconst vertical = (a: Element) => ['l', 'r'].includes(val(a, 'axPos') ?? '');\n\tconst secondaryPlaced = (a: Element) => val(a, 'crosses') === 'max' || ['r', 't'].includes(val(a, 'axPos') ?? '');\n\tconst groupValAxis = (g: Element) => {\n\t\tconst ids = kids(g, 'axId').map((a) => a.getAttribute('val'));\n\t\tconst axes = ids.map((id) => valAxes.find((a) => val(a, 'axId') === id)).filter((a): a is Element => !!a);\n\t\treturn axes.find(vertical) ?? axes[0];\n\t};\n\tconst groups = kids(plot).filter((g) => g.localName.endsWith('Chart'));\n\tconst used = groups.map(groupValAxis).filter((a): a is Element => !!a);\n\tconst primaryAxis = used.find((a) => !secondaryPlaced(a)) ?? used[0];\n\n\tconst series: ChartSeries[] = [];\n\tlet categories: string[] = [];\n\tconst types: ChartType[] = [];\n\tlet stacking: ChartSpec['stacking'] = 'none';\n\tlet orientation: ChartSpec['orientation'] = 'vertical';\n\tlet dataLabels = false;\n\tlet points = false;\n\tfor (const g of groups) {\n\t\tconst name = g.localName;\n\t\tconst grouping = val(g, 'grouping') ?? 'clustered';\n\t\tlet type: ChartType;\n\t\tif (/3D/.test(name)) unsupported.push(`3-D ${name.replace(/3DChart$/, '')} chart (drawn flat)`);\n\t\tswitch (name) {\n\t\t\tcase 'barChart':\n\t\t\tcase 'bar3DChart':\n\t\t\t\ttype = 'bar';\n\t\t\t\tif (val(g, 'barDir') === 'bar') orientation = 'horizontal';\n\t\t\t\tbreak;\n\t\t\tcase 'lineChart':\n\t\t\tcase 'line3DChart':\n\t\t\t\ttype = 'line';\n\t\t\t\t// Points are on when a series shows a marker (the group's marker flag is usually set).\n\t\t\t\tif (kids(g, 'ser').some((s) => (val(kid(s, 'marker'), 'symbol') ?? (bool(val(g, 'marker'), true) ? 'auto' : 'none')) !== 'none')) points = true;\n\t\t\t\tbreak;\n\t\t\tcase 'areaChart':\n\t\t\tcase 'area3DChart':\n\t\t\t\ttype = 'area';\n\t\t\t\tbreak;\n\t\t\tcase 'pieChart':\n\t\t\tcase 'pie3DChart':\n\t\t\tcase 'ofPieChart':\n\t\t\t\ttype = 'pie';\n\t\t\t\tif (name === 'ofPieChart') unsupported.push('pie-of-pie (drawn as one pie)');\n\t\t\t\tbreak;\n\t\t\tcase 'doughnutChart':\n\t\t\t\ttype = 'donut';\n\t\t\t\tinput.innerRadius = Math.min(0.9, Math.max(0, (numberOf(val(g, 'holeSize')) ?? 50) / 100));\n\t\t\t\tbreak;\n\t\t\tcase 'scatterChart':\n\t\t\t\ttype = 'scatter';\n\t\t\t\tif (/line/i.test(val(g, 'scatterStyle') ?? '')) points = true;\n\t\t\t\tbreak;\n\t\t\tcase 'bubbleChart':\n\t\t\t\ttype = 'bubble';\n\t\t\t\tbreak;\n\t\t\tcase 'radarChart':\n\t\t\t\ttype = 'radar';\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tunsupported.push(`${name.replace(/Chart$/, '')} chart`);\n\t\t\t\tcontinue;\n\t\t}\n\t\tif (grouping === 'stacked') stacking = 'stacked';\n\t\telse if (grouping === 'percentStacked') stacking = 'percent';\n\t\tconst gap = numberOf(val(g, 'gapWidth'));\n\t\tconst overlap = numberOf(val(g, 'overlap'));\n\t\tif (type === 'bar') {\n\t\t\t// gapWidth is the gap between groups as a % of one bar; ours is a fraction of the category.\n\t\t\tconst n = Math.max(1, kids(g, 'ser').length);\n\t\t\tconst g100 = (gap ?? 150) / 100;\n\t\t\tconst o = Math.max(-1, Math.min(1, (overlap ?? (grouping === 'clustered' ? 0 : 100)) / 100));\n\t\t\tconst barsWidth = grouping === 'clustered' ? n - (n - 1) * o : 1;\n\t\t\tinput.gapWidth = Math.round(Math.max(0, Math.min(0.9, g100 / (barsWidth + g100))) * 100) / 100;\n\t\t\tif (grouping === 'clustered') input.overlap = o;\n\t\t}\n\t\tif (bool(val(kid(g, 'dLbls'), 'showVal'))) dataLabels = true;\n\t\ttypes.push(type);\n\t\tconst axis = groupValAxis(g);\n\t\tconst secondary = !!axis && !!primaryAxis && axis !== primaryAxis;\n\t\tfor (const s of kids(g, 'ser').slice(0, 1000)) {\n\t\t\tconst out: ChartSeries = { id: `series-${series.length + 1}`, name: strings(kid(s, 'tx'))[0] ?? `Series ${series.length + 1}`, values: [] };\n\t\t\tconst color = solidColor(kid(s, 'spPr'));\n\t\t\tif (color) out.color = color;\n\t\t\tout.type = type === 'bubble' ? undefined : (type as ChartSeries['type']);\n\t\t\tif (secondary) out.axis = 'secondary';\n\t\t\tconst marker = val(kid(s, 'marker'), 'symbol');\n\t\t\t// Circles (and none on a line chart without points) are the defaults; other shapes are kept.\n\t\t\tif (marker && MARKERS[marker] && MARKERS[marker] !== 'circle' && (type === 'scatter' || MARKERS[marker] !== 'none') && (type === 'line' || type === 'scatter')) out.marker = MARKERS[marker];\n\t\t\tif (bool(val(s, 'smooth'))) out.curve = 'smooth';\n\t\t\tconst sl = kid(s, 'dLbls');\n\t\t\tif (sl && val(sl, 'showVal') !== undefined) out.dataLabels = bool(val(sl, 'showVal'));\n\t\t\tconst labelCode = [kid(sl, 'numFmt'), kid(kid(g, 'dLbls'), 'numFmt')].find((n) => n && n.getAttribute('sourceLinked') !== '1')?.getAttribute('formatCode');\n\t\t\tconst valueEl = kid(s, 'val') ?? kid(s, 'yVal');\n\t\t\tconst code = labelCode ?? formatCodeOf(valueEl);\n\t\t\tif (code && code !== 'General') out.format = { code };\n\t\t\tconst catEl = kid(s, 'cat') ?? kid(s, 'xVal');\n\t\t\tconst cats = strings(catEl);\n\t\t\tif (type === 'scatter' || type === 'bubble') {\n\t\t\t\tconst xs = cats.map((c) => numberOf(c.trim()));\n\t\t\t\tif (xs.some((x) => x !== null)) out.x = xs;\n\t\t\t}\n\t\t\tif (!categories.length && cats.length) categories = cats;\n\t\t\tout.values = numbers(valueEl);\n\t\t\tif (type === 'bubble') out.sizes = numbers(kid(s, 'bubbleSize'));\n\t\t\tconst dPts = kids(s, 'dPt');\n\t\t\tif (dPts.length) {\n\t\t\t\tconst pc: (string | null)[] = [];\n\t\t\t\tfor (const dp of dPts) {\n\t\t\t\t\tconst i = Number(val(dp, 'idx'));\n\t\t\t\t\tconst c = solidColor(kid(dp, 'spPr'));\n\t\t\t\t\tif (Number.isInteger(i) && i >= 0 && i < MAX_POINTS && c) {\n\t\t\t\t\t\twhile (pc.length <= i) pc.push(null);\n\t\t\t\t\t\tpc[i] = c;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (pc.some(Boolean)) out.pointColors = pc;\n\t\t\t}\n\t\t\tconst trends: ChartTrendline[] = [];\n\t\t\tfor (const t of kids(s, 'trendline')) {\n\t\t\t\tconst kind = TREND_IN[val(t, 'trendlineType') ?? ''];\n\t\t\t\tif (!kind) continue;\n\t\t\t\tconst line: ChartTrendline = { type: kind };\n\t\t\t\tconst order = numberOf(val(t, 'order'));\n\t\t\t\tconst period = numberOf(val(t, 'period'));\n\t\t\t\tif (kind === 'polynomial' && order) line.order = order;\n\t\t\t\tif (kind === 'moving-average' && period) line.period = period;\n\t\t\t\tfor (const k of ['forward', 'backward', 'intercept'] as const) {\n\t\t\t\t\tconst n = numberOf(val(t, k));\n\t\t\t\t\tif (n !== null && (k === 'intercept' || n > 0)) line[k] = n;\n\t\t\t\t}\n\t\t\t\tif (bool(val(t, 'dispEq'))) line.showEquation = true;\n\t\t\t\tif (bool(val(t, 'dispRSqr'))) line.showR2 = true;\n\t\t\t\tconst tName = kid(t, 'name')?.textContent;\n\t\t\t\tif (tName) line.name = tName;\n\t\t\t\tconst tc = solidColor(kid(t, 'spPr'));\n\t\t\t\tif (tc) line.color = tc;\n\t\t\t\ttrends.push(line);\n\t\t\t}\n\t\t\tif (trends.length) out.trendlines = trends;\n\t\t\tif (kids(s, 'errBars').length) unsupported.push('error bars');\n\t\t\tseries.push(out);\n\t\t}\n\t}\n\tif (!types.length) {\n\t\tissues.push({ path: 'plotArea', message: unsupported.length ? `The chart type is not supported: ${unsupported.join(', ')}.` : 'The chart has no plot groups.' });\n\t\treturn { spec: normalizeChartSpec(input).spec, issues, unsupported, lossless: false };\n\t}\n\tconst first = types[0];\n\tconst combo = types.some((t) => t !== first);\n\tinput.type = combo ? (types.includes('bar') ? 'bar' : first) : first;\n\tif (!combo) for (const s of series) delete s.type;\n\telse for (const s of series) if (s.type === input.type) delete s.type;\n\tif (!combo) for (const s of series) if (s.axis) issues.push({ path: 'series', message: `\"${s.name}\" is on a second value axis.` });\n\tif (types.some((t) => !isCartesianChart(t)) && combo) unsupported.push('a pie or radar mixed with other chart types');\n\tinput.series = series;\n\tinput.categories = categories.length ? categories : Array.from({ length: Math.max(0, ...series.map((s) => s.values.length)) }, (_, i) => `${i + 1}`);\n\tinput.stacking = stacking;\n\tinput.orientation = orientation;\n\tinput.dataLabels = dataLabels;\n\tinput.points = points || first !== 'line';\n\tif (bool(val(groups[0], 'varyColors')) && (first === 'bar' || first === 'line') && series.length === 1) unsupported.push('one colour per point (vary colours)');\n\n\t// Axes\n\tconst readAxis = (a: Element | undefined, fallback: ChartAxis): ChartAxis => {\n\t\tconst axis: ChartAxis = { ...fallback, format: {} };\n\t\tif (!a) return axis;\n\t\taxis.show = !bool(val(a, 'delete'));\n\t\taxis.title = richText(kid(a, 'title')) ?? '';\n\t\taxis.gridlines = !!kid(a, 'majorGridlines');\n\t\tconst scaling = kid(a, 'scaling');\n\t\taxis.min = numberOf(val(scaling, 'min'));\n\t\taxis.max = numberOf(val(scaling, 'max'));\n\t\tif (val(scaling, 'orientation') === 'maxMin') unsupported.push('a reversed axis');\n\t\tif (kid(scaling, 'logBase')) unsupported.push('a logarithmic axis');\n\t\taxis.step = numberOf(val(a, 'majorUnit'));\n\t\tconst fmt = kid(a, 'numFmt');\n\t\tconst code = fmt?.getAttribute('formatCode');\n\t\tif (code && code !== 'General' && fmt?.getAttribute('sourceLinked') !== '1') axis.format = { code };\n\t\treturn axis;\n\t};\n\tconst xy = first === 'scatter' || first === 'bubble';\n\tconst catAxis = kid(plot, 'catAx') ?? kid(plot, 'dateAx') ?? (xy ? valAxes.find((a) => !vertical(a)) : undefined);\n\tinput.xAxis = readAxis(catAxis, defaultChartAxis(false));\n\tif (kid(plot, 'dateAx')) (input.xAxis as ChartAxis).kind = 'date';\n\tinput.yAxis = readAxis(primaryAxis ?? valAxes.find(vertical) ?? valAxes[0], defaultChartAxis(true));\n\tconst secondaryAxis = valAxes.find((a) => a !== primaryAxis && (xy ? vertical(a) && a !== primaryAxis : true) && a !== catAxis);\n\tif (series.some((s) => s.axis === 'secondary') && secondaryAxis) input.yAxis2 = readAxis(secondaryAxis, defaultChartAxis(false));\n\tconst { spec, issues: specIssues } = normalizeChartSpec(input);\n\tissues.push(...specIssues);\n\tconst uniq = [...new Set(unsupported)];\n\treturn { spec, issues, unsupported: uniq, lossless: uniq.length === 0 && specIssues.length === 0 };\n}\n\nfunction readChartex(root: Element, issues: ChartIssue[], unsupported: string[]): ChartOoxmlReadResult {\n\tconst data = new Map<string, { categories: string[]; values: ChartValue[]; code?: string }>();\n\tfor (const d of kids(kid(root, 'chartData'), 'data')) {\n\t\tconst id = d.getAttribute('id') ?? String(data.size);\n\t\tconst strDim = kids(d, 'strDim')[0];\n\t\tconst numDim = kids(d, 'numDim')[0];\n\t\tconst lvl = (dim: Element | undefined) => kids(dim, 'lvl')[0];\n\t\tconst cats = kids(lvl(strDim), 'pt').map((p) => p.textContent ?? '');\n\t\tconst values: ChartValue[] = [];\n\t\tconst nl = lvl(numDim);\n\t\tfor (const p of kids(nl, 'pt')) {\n\t\t\tconst i = Number(p.getAttribute('idx') ?? values.length);\n\t\t\twhile (values.length < i) values.push(null);\n\t\t\tvalues[i] = numberOf((p.textContent ?? '').trim());\n\t\t}\n\t\tdata.set(id, { categories: cats, values, code: nl?.getAttribute('formatCode') ?? undefined });\n\t}\n\tconst chart = kid(root, 'chart');\n\tconst region = path(chart, 'plotArea', 'plotAreaRegion');\n\tconst seriesEls = kids(region, 'series');\n\tconst layouts: Record<string, ChartType> = { waterfall: 'waterfall', funnel: 'funnel', treemap: 'treemap', sunburst: 'treemap', boxWhisker: 'box', clusteredColumn: 'histogram', paretoLine: 'histogram' };\n\tconst layout = seriesEls[0]?.getAttribute('layoutId') ?? '';\n\tconst type = layouts[layout];\n\tif (!type) {\n\t\tissues.push({ path: 'plotArea', message: `The chart layout \"${layout || 'unknown'}\" is not supported.` });\n\t\treturn { spec: normalizeChartSpec({}).spec, issues, unsupported: [layout || 'unknown chartex layout'], lossless: false };\n\t}\n\tif (layout === 'sunburst') unsupported.push('sunburst (drawn as a treemap of the innermost level)');\n\tif (layout === 'paretoLine') unsupported.push('pareto line');\n\tconst series: ChartSeries[] = [];\n\tlet categories: string[] = [];\n\tfor (const s of seriesEls) {\n\t\tif (s.getAttribute('layoutId') === 'paretoLine') continue;\n\t\tconst ref = kid(s, 'dataId')?.getAttribute('val') ?? '0';\n\t\tconst d = data.get(ref);\n\t\tif (!d) continue;\n\t\tif (!categories.length) categories = d.categories;\n\t\tconst out: ChartSeries = { id: `series-${series.length + 1}`, name: strings(kid(s, 'tx'))[0] ?? `Series ${series.length + 1}`, values: d.values };\n\t\tif (d.code && d.code !== 'General') out.format = { code: d.code };\n\t\tseries.push(out);\n\t}\n\tconst title = richText(kid(chart, 'title'));\n\tconst longest = Math.max(0, ...series.map((s) => s.values.length));\n\tconst input: Record<string, unknown> = {\n\t\ttype,\n\t\ttitle: title ?? '',\n\t\tseries,\n\t\tcategories: categories.length >= longest ? categories : Array.from({ length: longest }, (_, i) => categories[i] ?? `${i + 1}`)\n\t};\n\tif (type === 'waterfall') input.showTotal = false;\n\tconst { spec, issues: specIssues } = normalizeChartSpec(input);\n\tissues.push(...specIssues);\n\treturn { spec, issues, unsupported, lossless: unsupported.length === 0 && specIssues.length === 0 };\n}\n\n// ---------------------------------------------------------------------------\n// Writing\n// ---------------------------------------------------------------------------\n\nconst esc = (s: string) => s.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/\"/g, '"');\nconst hex = (color: string | undefined) => {\n\tif (!color) return null;\n\tconst rgb = parseChartColor(color);\n\treturn rgb ? chartRgbToHex(rgb).slice(1).toUpperCase() : null;\n};\nconst fillXml = (color: string | undefined, line = false) => {\n\tconst h = hex(color);\n\tif (!h) return '';\n\treturn line ? `<c:spPr><a:ln w=\"28575\" cap=\"rnd\"><a:solidFill><a:srgbClr val=\"${h}\"/></a:solidFill><a:round/></a:ln></c:spPr>` : `<c:spPr><a:solidFill><a:srgbClr val=\"${h}\"/></a:solidFill></c:spPr>`;\n};\nconst rich = (text: string) => `<c:tx><c:rich><a:bodyPr/><a:lstStyle/><a:p><a:r><a:t>${esc(text)}</a:t></a:r></a:p></c:rich></c:tx><c:overlay val=\"0\"/>`;\nconst strLit = (items: readonly string[]) => `<c:strLit><c:ptCount val=\"${items.length}\"/>${items.map((s, i) => `<c:pt idx=\"${i}\"><c:v>${esc(s)}</c:v></c:pt>`).join('')}</c:strLit>`;\nconst numLit = (items: readonly ChartValue[], code = 'General') =>\n\t`<c:numLit><c:formatCode>${esc(code)}</c:formatCode><c:ptCount val=\"${items.length}\"/>${items.map((v, i) => (v === null || !Number.isFinite(v) ? '' : `<c:pt idx=\"${i}\"><c:v>${v}</c:v></c:pt>`)).join('')}</c:numLit>`;\n\nconst CURRENCY_SYMBOL: Record<string, string> = { USD: '$', EUR: '€', GBP: '£', JPY: '¥', CNY: '¥', INR: '₹' };\n\n/** A spreadsheet format code equivalent to a chart number format (`General` when there is none). */\nexport function chartFormatToCode(format: ChartNumberFormat): string {\n\tif (format.code) return format.code;\n\tconst d = format.decimals;\n\tconst frac = (n: number | undefined, fallback: number) => {\n\t\tconst k = n ?? fallback;\n\t\treturn k > 0 ? `.${'0'.repeat(k)}` : '';\n\t};\n\tconst wrap = (body: string) => `${format.prefix ? `\"${format.prefix.replace(/\"/g, '')}\"` : ''}${body}${format.suffix ? `\"${format.suffix.replace(/\"/g, '')}\"` : ''}`;\n\tswitch (format.style) {\n\t\tcase 'percent':\n\t\t\treturn wrap(`#,##0${frac(d, 0)}%`);\n\t\tcase 'currency': {\n\t\t\tconst code = (format.currency || 'USD').toUpperCase();\n\t\t\tconst sym = CURRENCY_SYMBOL[code] ?? `${code} `;\n\t\t\treturn wrap(`\"${sym}\"#,##0${frac(d, 0)}`);\n\t\t}\n\t\tcase 'compact':\n\t\t\treturn wrap('#,##0.0,,\"M\"');\n\t\tdefault:\n\t\t\treturn d !== undefined || format.prefix || format.suffix ? wrap(`#,##0${frac(d, 0)}`) : 'General';\n\t}\n}\n\nconst MARKER_OUT: Record<ChartMarker, string> = { circle: 'circle', square: 'square', diamond: 'diamond', triangle: 'triangle', cross: 'x', none: 'none' };\n\nexport interface ChartOoxmlWriteResult {\n\t/** The `c:chartSpace` part. */\n\txml: string;\n\t/** What could not be written as DrawingML, as sentences (empty when nothing was lost). */\n\tissues: string[];\n}\n\n/**\n * Writes a chart as a DrawingML chart part (`c:chartSpace`) with the data as literals (no\n * embedded workbook), for `word/charts/chartN.xml` or `ppt/charts/chartN.xml`. Waterfall,\n * histogram, box, funnel and treemap charts need Office 2016 chartex parts; they are written\n * as the closest classic chart and reported in `issues`.\n */\nexport function chartToOoxml(spec: ChartSpec): ChartOoxmlWriteResult {\n\tconst issues: string[] = [];\n\tconst family = chartFamily(spec);\n\tlet type = spec.type;\n\tif (family === 'waterfall' || family === 'histogram' || family === 'box' || family === 'funnel') {\n\t\tissues.push(`${spec.type} charts are written as bar charts: DrawingML has no ${spec.type} type (Office 2016 stores it as chartex).`);\n\t\ttype = 'bar';\n\t} else if (family === 'treemap') {\n\t\tissues.push('Treemaps are written as pie charts: DrawingML has no treemap type.');\n\t\ttype = 'pie';\n\t}\n\tconst visible = spec.series.filter((s) => !s.hidden);\n\tif (visible.length < spec.series.length) issues.push(`${spec.series.length - visible.length} hidden series ${spec.series.length - visible.length === 1 ? 'is' : 'are'} left out.`);\n\tconst grouping = spec.stacking === 'stacked' ? 'stacked' : spec.stacking === 'percent' ? 'percentStacked' : 'standard';\n\tconst ids = { cat: 500000001, val: 500000002, cat2: 500000003, val2: 500000004 };\n\tconst xy = family === 'xy' || type === 'scatter' || type === 'bubble';\n\tconst pieLike = type === 'pie' || type === 'donut';\n\tconst typed = (s: ChartSeries) => (pieLike || type === 'radar' ? type : type === 'bubble' ? 'bubble' : xy ? 'scatter' : chartSeriesType({ type }, s));\n\t// Groups: (kind, axis) in first-appearance order.\n\tconst groups: { kind: string; secondary: boolean; series: { s: ChartSeries; index: number }[] }[] = [];\n\tvisible.forEach((s) => {\n\t\tconst kind = typed(s);\n\t\tconst secondary = !pieLike && s.axis === 'secondary';\n\t\tlet g = groups.find((x) => x.kind === kind && x.secondary === secondary);\n\t\tif (!g) groups.push((g = { kind, secondary, series: [] }));\n\t\tg.series.push({ s, index: spec.series.indexOf(s) });\n\t});\n\tif (pieLike && visible.length > 1) issues.push('Only the first series of a pie is drawn; the others are kept in the part.');\n\tconst catLit = strLit(spec.categories);\n\tlet order = 0;\n\tconst serXml = (kind: string, s: ChartSeries, index: number) => {\n\t\tconst parts = [`<c:idx val=\"${index}\"/>`, `<c:order val=\"${order++}\"/>`, `<c:tx><c:v>${esc(s.name)}</c:v></c:tx>`];\n\t\tconst lineLike = kind === 'line' || kind === 'scatter' || kind === 'radar';\n\t\tparts.push(fillXml(s.color, lineLike));\n\t\tif (kind === 'bar' || kind === 'bubble') parts.push('<c:invertIfNegative val=\"0\"/>');\n\t\tif (lineLike) {\n\t\t\tconst marker = s.marker ?? (spec.points || kind === 'scatter' ? 'circle' : 'none');\n\t\t\tparts.push(`<c:marker><c:symbol val=\"${MARKER_OUT[marker]}\"/>${marker !== 'none' ? '<c:size val=\"5\"/>' : ''}</c:marker>`);\n\t\t}\n\t\t(s.pointColors ?? []).forEach((c, i) => {\n\t\t\tconst h = hex(c ?? undefined);\n\t\t\tif (h) parts.push(`<c:dPt><c:idx val=\"${i}\"/>${kind === 'bar' ? '<c:invertIfNegative val=\"0\"/>' : ''}<c:bubble3D val=\"0\"/><c:spPr><a:solidFill><a:srgbClr val=\"${h}\"/></a:solidFill></c:spPr></c:dPt>`);\n\t\t});\n\t\tconst labels = s.dataLabels ?? spec.dataLabels;\n\t\tconst code = s.format ? chartFormatToCode(s.format) : undefined;\n\t\tif (s.dataLabels !== undefined || code)\n\t\t\tparts.push(`<c:dLbls>${code ? `<c:numFmt formatCode=\"${esc(code)}\" sourceLinked=\"0\"/>` : ''}<c:showLegendKey val=\"0\"/><c:showVal val=\"${labels ? 1 : 0}\"/><c:showCatName val=\"0\"/><c:showSerName val=\"0\"/><c:showPercent val=\"0\"/><c:showBubbleSize val=\"0\"/></c:dLbls>`);\n\t\tif (!pieLike && kind !== 'radar')\n\t\t\tfor (const t of s.trendlines ?? []) {\n\t\t\t\tlet x = `<c:trendline>${t.name ? `<c:name>${esc(t.name)}</c:name>` : ''}${fillXml(t.color, true)}<c:trendlineType val=\"${TREND_OUT[t.type]}\"/>`;\n\t\t\t\tif (t.type === 'polynomial') x += `<c:order val=\"${t.order ?? 2}\"/>`;\n\t\t\t\tif (t.type === 'moving-average') x += `<c:period val=\"${t.period ?? 2}\"/>`;\n\t\t\t\tif (t.forward) x += `<c:forward val=\"${t.forward}\"/>`;\n\t\t\t\tif (t.backward) x += `<c:backward val=\"${t.backward}\"/>`;\n\t\t\t\tif (t.intercept !== undefined && t.intercept !== null) x += `<c:intercept val=\"${t.intercept}\"/>`;\n\t\t\t\tx += `<c:dispRSqr val=\"${t.showR2 ? 1 : 0}\"/><c:dispEq val=\"${t.showEquation ? 1 : 0}\"/></c:trendline>`;\n\t\t\t\tparts.push(x);\n\t\t\t}\n\t\tconst valCode = chartFormatToCode(s.format ?? (s.axis === 'secondary' ? spec.yAxis2.format : spec.yAxis.format));\n\t\tif (kind === 'scatter' || kind === 'bubble') {\n\t\t\tconst xs = s.x ?? spec.categories.map((_, i) => i + 1);\n\t\t\tparts.push(`<c:xVal>${numLit(xs)}</c:xVal><c:yVal>${numLit(s.values, valCode)}</c:yVal>`);\n\t\t\tif (kind === 'bubble') parts.push(`<c:bubbleSize>${numLit(s.sizes ?? s.values.map(() => 1))}</c:bubbleSize><c:bubble3D val=\"0\"/>`);\n\t\t\telse parts.push(`<c:smooth val=\"${(s.curve ?? spec.curve) === 'smooth' ? 1 : 0}\"/>`);\n\t\t} else {\n\t\t\tparts.push(`<c:cat>${catLit}</c:cat><c:val>${numLit(s.values, valCode)}</c:val>`);\n\t\t\tif (kind === 'line') parts.push(`<c:smooth val=\"${(s.curve ?? spec.curve) === 'smooth' ? 1 : 0}\"/>`);\n\t\t}\n\t\tif ((s.curve ?? spec.curve) === 'step' && lineLike) issues.push(`\"${s.name}\" uses step lines, which DrawingML cannot express; they are written straight.`);\n\t\tif ((s.curve ?? spec.curve) === 'smooth' && kind === 'area') issues.push(`\"${s.name}\" is a smoothed area, which DrawingML cannot express; it is written straight.`);\n\t\treturn `<c:ser>${parts.join('')}</c:ser>`;\n\t};\n\tconst dLbls = `<c:dLbls><c:showLegendKey val=\"0\"/><c:showVal val=\"${spec.dataLabels ? 1 : 0}\"/><c:showCatName val=\"0\"/><c:showSerName val=\"0\"/><c:showPercent val=\"0\"/><c:showBubbleSize val=\"0\"/></c:dLbls>`;\n\tconst groupXml = groups.map((g) => {\n\t\tconst axes = g.secondary ? `<c:axId val=\"${ids.cat2}\"/><c:axId val=\"${ids.val2}\"/>` : `<c:axId val=\"${ids.cat}\"/><c:axId val=\"${ids.val}\"/>`;\n\t\tconst sers = g.series.map(({ s, index }) => serXml(g.kind, s, index)).join('');\n\t\tswitch (g.kind) {\n\t\t\tcase 'bar': {\n\t\t\t\tconst n = g.series.length;\n\t\t\t\tconst barsWidth = spec.stacking === 'none' ? n - (n - 1) * spec.overlap : 1;\n\t\t\t\tconst gapPct = Math.round(Math.min(500, (spec.gapWidth / Math.max(0.01, 1 - spec.gapWidth)) * barsWidth * 100));\n\t\t\t\tconst overlapPct = spec.stacking === 'none' ? Math.round(spec.overlap * 100) : 100;\n\t\t\t\treturn `<c:barChart><c:barDir val=\"${spec.orientation === 'horizontal' ? 'bar' : 'col'}\"/><c:grouping val=\"${spec.stacking === 'none' ? 'clustered' : grouping}\"/><c:varyColors val=\"0\"/>${sers}${dLbls}<c:gapWidth val=\"${gapPct}\"/><c:overlap val=\"${overlapPct}\"/>${axes}</c:barChart>`;\n\t\t\t}\n\t\t\tcase 'line':\n\t\t\t\treturn `<c:lineChart><c:grouping val=\"${spec.stacking === 'none' ? 'standard' : 'standard'}\"/><c:varyColors val=\"0\"/>${sers}${dLbls}<c:marker val=\"1\"/>${axes}</c:lineChart>`;\n\t\t\tcase 'area':\n\t\t\t\treturn `<c:areaChart><c:grouping val=\"${grouping}\"/><c:varyColors val=\"0\"/>${sers}${dLbls}${axes}</c:areaChart>`;\n\t\t\tcase 'scatter':\n\t\t\t\treturn `<c:scatterChart><c:scatterStyle val=\"lineMarker\"/><c:varyColors val=\"0\"/>${sers}${dLbls}${axes}</c:scatterChart>`;\n\t\t\tcase 'bubble':\n\t\t\t\treturn `<c:bubbleChart><c:varyColors val=\"0\"/>${sers}${dLbls}<c:bubbleScale val=\"100\"/>${axes}</c:bubbleChart>`;\n\t\t\tcase 'radar':\n\t\t\t\treturn `<c:radarChart><c:radarStyle val=\"marker\"/><c:varyColors val=\"0\"/>${sers}${dLbls}${axes}</c:radarChart>`;\n\t\t\tcase 'donut':\n\t\t\t\treturn `<c:doughnutChart><c:varyColors val=\"1\"/>${sers}${dLbls}<c:firstSliceAng val=\"0\"/><c:holeSize val=\"${Math.round(Math.max(10, Math.min(90, spec.innerRadius * 100)))}\"/></c:doughnutChart>`;\n\t\t\tdefault:\n\t\t\t\treturn `<c:pieChart><c:varyColors val=\"1\"/>${sers}${dLbls}<c:firstSliceAng val=\"0\"/></c:pieChart>`;\n\t\t}\n\t});\n\tconst scaling = (a: ChartAxis) => `<c:scaling><c:orientation val=\"minMax\"/>${a.max !== null ? `<c:max val=\"${a.max}\"/>` : ''}${a.min !== null ? `<c:min val=\"${a.min}\"/>` : ''}</c:scaling>`;\n\tconst title = (a: ChartAxis) => (a.title ? `<c:title>${rich(a.title)}</c:title>` : '');\n\tconst fmt = (a: ChartAxis) => {\n\t\tconst code = chartFormatToCode(a.format);\n\t\treturn code !== 'General' ? `<c:numFmt formatCode=\"${esc(code)}\" sourceLinked=\"0\"/>` : `<c:numFmt formatCode=\"${spec.stacking === 'percent' ? '0%' : 'General'}\" sourceLinked=\"1\"/>`;\n\t};\n\tconst horizontal = spec.orientation === 'horizontal';\n\tconst catPos = horizontal ? 'l' : 'b';\n\tconst valPos = horizontal ? 'b' : 'l';\n\tconst valAx = (id: number, cross: number, a: ChartAxis, pos: string, crosses: string, catKind = false) =>\n\t\t`<c:valAx><c:axId val=\"${id}\"/>${scaling(a)}<c:delete val=\"${a.show ? 0 : 1}\"/><c:axPos val=\"${pos}\"/>${a.gridlines ? '<c:majorGridlines/>' : ''}${title(a)}${fmt(a)}<c:majorTickMark val=\"out\"/><c:minorTickMark val=\"none\"/><c:tickLblPos val=\"nextTo\"/><c:crossAx val=\"${cross}\"/><c:crosses val=\"${crosses}\"/><c:crossBetween val=\"${catKind ? 'midCat' : 'between'}\"/>${a.step ? `<c:majorUnit val=\"${a.step}\"/>` : ''}</c:valAx>`;\n\tconst catAx = (id: number, cross: number, a: ChartAxis, pos: string, hidden = false) =>\n\t\t`<c:${a.kind === 'date' ? 'dateAx' : 'catAx'}><c:axId val=\"${id}\"/><c:scaling><c:orientation val=\"minMax\"/></c:scaling><c:delete val=\"${a.show && !hidden ? 0 : 1}\"/><c:axPos val=\"${pos}\"/>${a.gridlines ? '<c:majorGridlines/>' : ''}${title(a)}<c:numFmt formatCode=\"General\" sourceLinked=\"1\"/><c:majorTickMark val=\"out\"/><c:minorTickMark val=\"none\"/><c:tickLblPos val=\"nextTo\"/><c:crossAx val=\"${cross}\"/><c:crosses val=\"autoZero\"/><c:auto val=\"1\"/>${a.kind === 'date' ? '<c:lblOffset val=\"100\"/><c:baseTimeUnit val=\"days\"/>' : '<c:lblAlgn val=\"ctr\"/><c:lblOffset val=\"100\"/><c:noMultiLvlLbl val=\"0\"/>'}</c:${a.kind === 'date' ? 'dateAx' : 'catAx'}>`;\n\tlet axes = '';\n\tif (!pieLike) {\n\t\tif (xy) axes = valAx(ids.cat, ids.val, spec.xAxis, 'b', 'autoZero', true) + valAx(ids.val, ids.cat, spec.yAxis, 'l', 'autoZero', true);\n\t\telse axes = catAx(ids.cat, ids.val, spec.xAxis, catPos) + valAx(ids.val, ids.cat, spec.yAxis, valPos, 'autoZero');\n\t\tif (groups.some((g) => g.secondary)) axes += catAx(ids.cat2, ids.val2, spec.xAxis, catPos, true) + valAx(ids.val2, ids.cat2, spec.yAxis2, horizontal ? 't' : 'r', 'max');\n\t}\n\tconst legendPos = { bottom: 'b', top: 't', left: 'l', right: 'r' }[spec.legend.position];\n\tconst legend = spec.legend.show ? `<c:legend><c:legendPos val=\"${legendPos}\"/><c:overlay val=\"0\"/></c:legend>` : '';\n\tconst titleXml = spec.title ? `<c:title>${rich(spec.title)}</c:title><c:autoTitleDeleted val=\"0\"/>` : '<c:autoTitleDeleted val=\"1\"/>';\n\tif (spec.subtitle) issues.push('The subtitle is left out: DrawingML charts have one title.');\n\tif (family === 'radar' && spec.series.some((s) => s.trendlines?.length)) issues.push('Trendlines on a radar chart are left out.');\n\tconst xml =\n\t\t`<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>` +\n\t\t`<c:chartSpace xmlns:c=\"${CHART_OOXML_NS}\" xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\">` +\n\t\t`<c:roundedCorners val=\"0\"/><c:chart>${titleXml}<c:plotArea><c:layout/>${groupXml.join('')}${axes}</c:plotArea>${legend}<c:plotVisOnly val=\"1\"/><c:dispBlanksAs val=\"gap\"/></c:chart>` +\n\t\t`<c:txPr><a:bodyPr/><a:lstStyle/><a:p><a:pPr><a:defRPr sz=\"${Math.round(10 * 100)}\"/></a:pPr><a:endParaRPr lang=\"en-US\"/></a:p></c:txPr></c:chartSpace>`;\n\treturn { xml, issues: [...new Set(issues)] };\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/editor/editor/packages/core/dist/chunk-3JNRQVTS.cjs","../src/chart/ooxml.ts"],"names":["rich"],"mappings":"AAAA;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACF,wDAA6B;AAC7B;AACA;ACDO,IAAM,eAAA,EAAiB,wDAAA;AACvB,IAAM,yBAAA,EAA2B,mEAAA;AACjC,IAAM,yBAAA,EAA2B,2EAAA;AAsBxC,IAAM,WAAA,EAAa,GAAA;AAEnB,SAAS,MAAA,CAAO,OAAA,EAA4C;AAC3D,EAAA,MAAM,EAAA,mBAAI,OAAA,CAAQ,SAAA,UAAc,UAAA,CAA0C,WAAA;AAC1E,EAAA,GAAA,CAAI,CAAC,CAAA,EAAG,MAAM,IAAI,KAAA,CAAM,8GAA8G,CAAA;AACtI,EAAA,OAAO,CAAA;AACR;AAEA,IAAM,KAAA,EAAO,CAAC,EAAA,EAAgC,IAAA,EAAA,GAA8B,GAAA,EAAK,KAAA,CAAM,IAAA,CAAK,EAAA,CAAG,UAAU,CAAA,CAAE,MAAA,CAAO,CAAC,CAAA,EAAA,GAAoB,CAAA,CAAE,SAAA,IAAa,EAAA,GAAA,CAAM,CAAC,KAAA,GAAS,CAAA,CAAc,UAAA,IAAc,IAAA,CAAK,EAAA,EAAI,CAAC,CAAA;AAC5M,IAAM,IAAA,EAAM,CAAC,EAAA,EAAgC,IAAA,EAAA,GAAiB,IAAA,CAAK,EAAA,EAAI,IAAI,CAAA,CAAE,CAAC,CAAA;AAC9E,IAAM,IAAA,EAAM,CAAC,EAAA,EAAgC,IAAA,EAAA,oCAAiB,GAAA,mBAAI,EAAA,EAAI,IAAI,CAAA,6BAAG,YAAA,mBAAa,KAAK,GAAA,UAAK,KAAA,GAAA;AACpG,IAAM,KAAA,EAAO,CAAC,EAAA,EAAA,GAAmC,KAAA,EAAA,GAAoB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IAAA;AACtB,IAAA;AAChC,EAAA;AACc,EAAA;AACqB,EAAA;AACiB,IAAA;AACE,IAAA;AACrC,IAAA;AACH,MAAA;AACQ,QAAA;AAC+B,QAAA;AACJ,QAAA;AACK,QAAA;AACT,QAAA;AAC3C,MAAA;AACK,MAAA;AACyC,QAAA;AACzC,MAAA;AAC4C,QAAA;AAC5C,MAAA;AACG,QAAA;AACH,MAAA;AACgD,QAAA;AAChD,MAAA;AACG,QAAA;AACH,MAAA;AAC8C,QAAA;AACnD,MAAA;AACqD,QAAA;AACtD,IAAA;AACA,EAAA;AACiC,EAAA;AACkC,EAAA;AACtC,EAAA;AACU,IAAA;AACkB,IAAA;AAC1D,EAAA;AACwC,EAAA;AACN,EAAA;AACA,EAAA;AAC8D,EAAA;AAGzF,EAAA;AACI,EAAA;AACG,EAAA;AAC2C,IAAA;AACF,IAAA;AACC,IAAA;AACxD,EAAA;AACsD,EAAA;AACpB,EAAA;AACwB,EAAA;AAC3B,EAAA;AACqB,EAAA;AAEnD,EAAA;AAI0C,EAAA;AAC5C;ADvE6D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"/home/runner/work/editor/editor/packages/core/dist/chunk-3JNRQVTS.cjs","sourcesContent":[null,"// The DrawingML chart reader follows deckcraft-main/crates/pptx/src/read/chart.rs (group → type mapping,\n// secondary-axis detection by axis id and position, cache / literal data, number-format precedence) and the\n// chartex reader gridcraft-main/crates/xlsx/src/chartex.rs; the \"editable only when it regenerates\" idea is\n// from wordcraft-main/crates/docx/src/chart_spec.rs (MIT OR Apache-2.0, © ArtCraft Team and contributors).\n// See THIRD_PARTY_NOTICES.md.\nimport { parseChartColor, chartRgbToHex } from './color.js';\nimport { chartFamily, chartSeriesType, defaultChartAxis, isCartesianChart, normalizeChartSpec } from './spec.js';\nimport type { ChartAxis, ChartIssue, ChartLegendPosition, ChartMarker, ChartNumberFormat, ChartSeries, ChartSpec, ChartTrendline, ChartTrendlineType, ChartType, ChartValue } from './types.js';\n\nexport const CHART_OOXML_NS = 'http://schemas.openxmlformats.org/drawingml/2006/chart';\nexport const CHART_OOXML_CONTENT_TYPE = 'application/vnd.openxmlformats-officedocument.drawingml.chart+xml';\nexport const CHART_OOXML_RELATIONSHIP = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/chart';\n\ntype ParserCtor = { new (): DOMParser };\n\nexport interface ChartOoxmlReadOptions {\n\t/** `DOMParser` constructor (default: the global one; pass jsdom's or xmldom's in Node). */\n\tDOMParser?: ParserCtor;\n}\n\nexport interface ChartOoxmlReadResult {\n\tspec: ChartSpec;\n\t/** Problems and simplifications, as sentences. */\n\tissues: ChartIssue[];\n\t/** Features the file uses that the spec cannot hold (3-D, stock, surface, gradients, …). */\n\tunsupported: string[];\n\t/**\n\t * Nothing was dropped: writing `spec` back gives an equivalent chart. When false, keep the\n\t * original part (or show the chart read-only) if the file must stay as it was.\n\t */\n\tlossless: boolean;\n}\n\nconst MAX_POINTS = 100_000;\n\nfunction parser(options: ChartOoxmlReadOptions): ParserCtor {\n\tconst P = options.DOMParser ?? (globalThis as { DOMParser?: ParserCtor }).DOMParser;\n\tif (!P) throw new Error('Reading chart XML needs a DOMParser. In Node, pass one (e.g. from jsdom or @xmldom/xmldom) as { DOMParser }.');\n\treturn P;\n}\n\nconst kids = (el: Element | null | undefined, name?: string): Element[] => (el ? Array.from(el.childNodes).filter((n): n is Element => n.nodeType === 1 && (!name || (n as Element).localName === name)) : []);\nconst kid = (el: Element | null | undefined, name: string) => kids(el, name)[0];\nconst val = (el: Element | null | undefined, name: string) => kid(el, name)?.getAttribute('val') ?? undefined;\nconst path = (el: Element | null | undefined, ...names: string[]) => names.reduce<Element | undefined>((e, n) => kid(e, n), el ?? undefined);\nconst find = (el: Element | null | undefined, name: string): Element | undefined => {\n\tif (!el) return undefined;\n\tfor (const c of kids(el)) {\n\t\tif (c.localName === name) return c;\n\t\tconst deep = find(c, name);\n\t\tif (deep) return deep;\n\t}\n\treturn undefined;\n};\nconst bool = (v: string | undefined, fallback = false) => (v === undefined ? fallback : v === '1' || v === 'true');\nconst numberOf = (v: string | undefined) => {\n\tif (v === undefined) return null;\n\tconst n = Number(v);\n\treturn Number.isFinite(n) ? n : null;\n};\n\nfunction strings(e: Element | undefined): string[] {\n\tif (!e) return [];\n\tconst cache = find(e, 'strCache') ?? find(e, 'numCache') ?? find(e, 'strLit') ?? find(e, 'numLit');\n\tif (cache) {\n\t\tconst n = Math.min(MAX_POINTS, Number(val(cache, 'ptCount') ?? 0) || 0);\n\t\tconst out: string[] = Array(n).fill('');\n\t\tfor (const pt of kids(cache, 'pt').slice(0, MAX_POINTS)) {\n\t\t\tconst i = Number(pt.getAttribute('idx') ?? 0);\n\t\t\tif (!Number.isInteger(i) || i < 0 || i >= MAX_POINTS) continue;\n\t\t\twhile (out.length <= i) out.push('');\n\t\t\tout[i] = kid(pt, 'v')?.textContent ?? '';\n\t\t}\n\t\treturn out;\n\t}\n\tconst multi = find(e, 'multiLvlStrCache');\n\tif (multi) {\n\t\tconst lvl = kid(multi, 'lvl');\n\t\treturn kids(lvl, 'pt').map((p) => kid(p, 'v')?.textContent ?? '');\n\t}\n\tconst v = kid(e, 'v') ?? find(e, 'v');\n\treturn v ? [v.textContent ?? ''] : [];\n}\n\nconst numbers = (e: Element | undefined): ChartValue[] => strings(e).map((s) => (s.trim() === '' ? null : numberOf(s.trim())));\n\nfunction formatCodeOf(e: Element | undefined): string | undefined {\n\treturn find(e, 'numCache') ? (kid(find(e, 'numCache'), 'formatCode')?.textContent ?? undefined) : undefined;\n}\n\nfunction richText(t: Element | undefined): string | undefined {\n\tif (!t) return undefined;\n\tconst tx = kid(t, 'tx');\n\tconst rich = kid(tx, 'rich');\n\tif (rich) return kids(rich, 'p').map((p) => Array.from(p.getElementsByTagNameNS('*', 't')).map((x) => x.textContent ?? '').join('')).join('\\n');\n\tconst v = find(tx, 'v');\n\treturn v?.textContent ?? undefined;\n}\n\nfunction solidColor(spPr: Element | undefined): string | undefined {\n\tconst fill = kid(spPr, 'solidFill') ?? kid(kid(spPr, 'ln'), 'solidFill');\n\tconst srgb = kid(fill, 'srgbClr');\n\tconst v = srgb?.getAttribute('val');\n\treturn v && /^[0-9a-f]{6}$/i.test(v) ? `#${v.toLowerCase()}` : undefined;\n}\n\nconst MARKERS: Record<string, ChartMarker> = { circle: 'circle', dot: 'circle', square: 'square', diamond: 'diamond', triangle: 'triangle', x: 'cross', plus: 'cross', star: 'cross', dash: 'square', none: 'none' };\nconst TREND_IN: Record<string, ChartTrendlineType> = { linear: 'linear', exp: 'exponential', log: 'logarithmic', poly: 'polynomial', power: 'power', movingAvg: 'moving-average' };\nconst TREND_OUT: Record<ChartTrendlineType, string> = { linear: 'linear', exponential: 'exp', logarithmic: 'log', polynomial: 'poly', power: 'power', 'moving-average': 'movingAvg' };\nconst LEGEND_IN: Record<string, ChartLegendPosition> = { b: 'bottom', t: 'top', l: 'left', r: 'right', tr: 'right' };\n\n/**\n * Reads a DrawingML chart part (`c:chartSpace`, e.g. `word/charts/chart1.xml`) or an Office\n * 2016 chartex part (`cx:chartSpace`: waterfall, funnel, treemap, histogram, box & whisker)\n * as a chart spec. Data comes from the cached values. Never throws for a malformed chart: it\n * returns an empty chart and says why.\n */\nexport function chartFromOoxml(xml: string, options: ChartOoxmlReadOptions = {}): ChartOoxmlReadResult {\n\tconst issues: ChartIssue[] = [];\n\tconst unsupported: string[] = [];\n\tlet doc: Document;\n\ttry {\n\t\tdoc = new (parser(options))().parseFromString(xml, 'application/xml');\n\t} catch (error) {\n\t\treturn { spec: normalizeChartSpec({}).spec, issues: [{ path: '', message: `The chart XML could not be read: ${(error as Error).message}` }], unsupported, lossless: false };\n\t}\n\tconst root = doc.documentElement;\n\tif (!root || root.localName !== 'chartSpace' || doc.getElementsByTagName('parsererror').length) {\n\t\treturn { spec: normalizeChartSpec({}).spec, issues: [{ path: '', message: 'This is not a chart part: expected a c:chartSpace (or cx:chartSpace) root element.' }], unsupported, lossless: false };\n\t}\n\tif (root.namespaceURI?.includes('chartex') || kid(root, 'chartData')) return readChartex(root, issues, unsupported);\n\n\tconst chart = kid(root, 'chart');\n\tconst plot = kid(chart, 'plotArea');\n\tconst input: Record<string, unknown> = { type: 'bar' };\n\tconst titleEl = kid(chart, 'title');\n\tif (titleEl && !bool(val(chart, 'autoTitleDeleted'))) input.title = richText(titleEl) ?? '';\n\tconst legend = kid(chart, 'legend');\n\tinput.legend = { show: !!legend, position: LEGEND_IN[val(legend, 'legendPos') ?? 'r'] ?? 'right' };\n\tif (kid(root, 'roundedCorners') && bool(val(root, 'roundedCorners'))) unsupported.push('rounded corners');\n\n\tconst valAxes = kids(plot, 'valAx');\n\tconst vertical = (a: Element) => ['l', 'r'].includes(val(a, 'axPos') ?? '');\n\tconst secondaryPlaced = (a: Element) => val(a, 'crosses') === 'max' || ['r', 't'].includes(val(a, 'axPos') ?? '');\n\tconst groupValAxis = (g: Element) => {\n\t\tconst ids = kids(g, 'axId').map((a) => a.getAttribute('val'));\n\t\tconst axes = ids.map((id) => valAxes.find((a) => val(a, 'axId') === id)).filter((a): a is Element => !!a);\n\t\treturn axes.find(vertical) ?? axes[0];\n\t};\n\tconst groups = kids(plot).filter((g) => g.localName.endsWith('Chart'));\n\tconst used = groups.map(groupValAxis).filter((a): a is Element => !!a);\n\tconst primaryAxis = used.find((a) => !secondaryPlaced(a)) ?? used[0];\n\n\tconst series: ChartSeries[] = [];\n\tlet categories: string[] = [];\n\tconst types: ChartType[] = [];\n\tlet stacking: ChartSpec['stacking'] = 'none';\n\tlet orientation: ChartSpec['orientation'] = 'vertical';\n\tlet dataLabels = false;\n\tlet points = false;\n\tfor (const g of groups) {\n\t\tconst name = g.localName;\n\t\tconst grouping = val(g, 'grouping') ?? 'clustered';\n\t\tlet type: ChartType;\n\t\tif (/3D/.test(name)) unsupported.push(`3-D ${name.replace(/3DChart$/, '')} chart (drawn flat)`);\n\t\tswitch (name) {\n\t\t\tcase 'barChart':\n\t\t\tcase 'bar3DChart':\n\t\t\t\ttype = 'bar';\n\t\t\t\tif (val(g, 'barDir') === 'bar') orientation = 'horizontal';\n\t\t\t\tbreak;\n\t\t\tcase 'lineChart':\n\t\t\tcase 'line3DChart':\n\t\t\t\ttype = 'line';\n\t\t\t\t// Points are on when a series shows a marker (the group's marker flag is usually set).\n\t\t\t\tif (kids(g, 'ser').some((s) => (val(kid(s, 'marker'), 'symbol') ?? (bool(val(g, 'marker'), true) ? 'auto' : 'none')) !== 'none')) points = true;\n\t\t\t\tbreak;\n\t\t\tcase 'areaChart':\n\t\t\tcase 'area3DChart':\n\t\t\t\ttype = 'area';\n\t\t\t\tbreak;\n\t\t\tcase 'pieChart':\n\t\t\tcase 'pie3DChart':\n\t\t\tcase 'ofPieChart':\n\t\t\t\ttype = 'pie';\n\t\t\t\tif (name === 'ofPieChart') unsupported.push('pie-of-pie (drawn as one pie)');\n\t\t\t\tbreak;\n\t\t\tcase 'doughnutChart':\n\t\t\t\ttype = 'donut';\n\t\t\t\tinput.innerRadius = Math.min(0.9, Math.max(0, (numberOf(val(g, 'holeSize')) ?? 50) / 100));\n\t\t\t\tbreak;\n\t\t\tcase 'scatterChart':\n\t\t\t\ttype = 'scatter';\n\t\t\t\tif (/line/i.test(val(g, 'scatterStyle') ?? '')) points = true;\n\t\t\t\tbreak;\n\t\t\tcase 'bubbleChart':\n\t\t\t\ttype = 'bubble';\n\t\t\t\tbreak;\n\t\t\tcase 'radarChart':\n\t\t\t\ttype = 'radar';\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tunsupported.push(`${name.replace(/Chart$/, '')} chart`);\n\t\t\t\tcontinue;\n\t\t}\n\t\tif (grouping === 'stacked') stacking = 'stacked';\n\t\telse if (grouping === 'percentStacked') stacking = 'percent';\n\t\tconst gap = numberOf(val(g, 'gapWidth'));\n\t\tconst overlap = numberOf(val(g, 'overlap'));\n\t\tif (type === 'bar') {\n\t\t\t// gapWidth is the gap between groups as a % of one bar; ours is a fraction of the category.\n\t\t\tconst n = Math.max(1, kids(g, 'ser').length);\n\t\t\tconst g100 = (gap ?? 150) / 100;\n\t\t\tconst o = Math.max(-1, Math.min(1, (overlap ?? (grouping === 'clustered' ? 0 : 100)) / 100));\n\t\t\tconst barsWidth = grouping === 'clustered' ? n - (n - 1) * o : 1;\n\t\t\tinput.gapWidth = Math.round(Math.max(0, Math.min(0.9, g100 / (barsWidth + g100))) * 100) / 100;\n\t\t\tif (grouping === 'clustered') input.overlap = o;\n\t\t}\n\t\tif (bool(val(kid(g, 'dLbls'), 'showVal'))) dataLabels = true;\n\t\ttypes.push(type);\n\t\tconst axis = groupValAxis(g);\n\t\tconst secondary = !!axis && !!primaryAxis && axis !== primaryAxis;\n\t\tfor (const s of kids(g, 'ser').slice(0, 1000)) {\n\t\t\tconst out: ChartSeries = { id: `series-${series.length + 1}`, name: strings(kid(s, 'tx'))[0] ?? `Series ${series.length + 1}`, values: [] };\n\t\t\tconst color = solidColor(kid(s, 'spPr'));\n\t\t\tif (color) out.color = color;\n\t\t\tout.type = type === 'bubble' ? undefined : (type as ChartSeries['type']);\n\t\t\tif (secondary) out.axis = 'secondary';\n\t\t\tconst marker = val(kid(s, 'marker'), 'symbol');\n\t\t\t// Circles (and none on a line chart without points) are the defaults; other shapes are kept.\n\t\t\tif (marker && MARKERS[marker] && MARKERS[marker] !== 'circle' && (type === 'scatter' || MARKERS[marker] !== 'none') && (type === 'line' || type === 'scatter')) out.marker = MARKERS[marker];\n\t\t\tif (bool(val(s, 'smooth'))) out.curve = 'smooth';\n\t\t\tconst sl = kid(s, 'dLbls');\n\t\t\tif (sl && val(sl, 'showVal') !== undefined) out.dataLabels = bool(val(sl, 'showVal'));\n\t\t\tconst labelCode = [kid(sl, 'numFmt'), kid(kid(g, 'dLbls'), 'numFmt')].find((n) => n && n.getAttribute('sourceLinked') !== '1')?.getAttribute('formatCode');\n\t\t\tconst valueEl = kid(s, 'val') ?? kid(s, 'yVal');\n\t\t\tconst code = labelCode ?? formatCodeOf(valueEl);\n\t\t\tif (code && code !== 'General') out.format = { code };\n\t\t\tconst catEl = kid(s, 'cat') ?? kid(s, 'xVal');\n\t\t\tconst cats = strings(catEl);\n\t\t\tif (type === 'scatter' || type === 'bubble') {\n\t\t\t\tconst xs = cats.map((c) => numberOf(c.trim()));\n\t\t\t\tif (xs.some((x) => x !== null)) out.x = xs;\n\t\t\t}\n\t\t\tif (!categories.length && cats.length) categories = cats;\n\t\t\tout.values = numbers(valueEl);\n\t\t\tif (type === 'bubble') out.sizes = numbers(kid(s, 'bubbleSize'));\n\t\t\tconst dPts = kids(s, 'dPt');\n\t\t\tif (dPts.length) {\n\t\t\t\tconst pc: (string | null)[] = [];\n\t\t\t\tfor (const dp of dPts) {\n\t\t\t\t\tconst i = Number(val(dp, 'idx'));\n\t\t\t\t\tconst c = solidColor(kid(dp, 'spPr'));\n\t\t\t\t\tif (Number.isInteger(i) && i >= 0 && i < MAX_POINTS && c) {\n\t\t\t\t\t\twhile (pc.length <= i) pc.push(null);\n\t\t\t\t\t\tpc[i] = c;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (pc.some(Boolean)) out.pointColors = pc;\n\t\t\t}\n\t\t\tconst trends: ChartTrendline[] = [];\n\t\t\tfor (const t of kids(s, 'trendline')) {\n\t\t\t\tconst kind = TREND_IN[val(t, 'trendlineType') ?? ''];\n\t\t\t\tif (!kind) continue;\n\t\t\t\tconst line: ChartTrendline = { type: kind };\n\t\t\t\tconst order = numberOf(val(t, 'order'));\n\t\t\t\tconst period = numberOf(val(t, 'period'));\n\t\t\t\tif (kind === 'polynomial' && order) line.order = order;\n\t\t\t\tif (kind === 'moving-average' && period) line.period = period;\n\t\t\t\tfor (const k of ['forward', 'backward', 'intercept'] as const) {\n\t\t\t\t\tconst n = numberOf(val(t, k));\n\t\t\t\t\tif (n !== null && (k === 'intercept' || n > 0)) line[k] = n;\n\t\t\t\t}\n\t\t\t\tif (bool(val(t, 'dispEq'))) line.showEquation = true;\n\t\t\t\tif (bool(val(t, 'dispRSqr'))) line.showR2 = true;\n\t\t\t\tconst tName = kid(t, 'name')?.textContent;\n\t\t\t\tif (tName) line.name = tName;\n\t\t\t\tconst tc = solidColor(kid(t, 'spPr'));\n\t\t\t\tif (tc) line.color = tc;\n\t\t\t\ttrends.push(line);\n\t\t\t}\n\t\t\tif (trends.length) out.trendlines = trends;\n\t\t\tif (kids(s, 'errBars').length) unsupported.push('error bars');\n\t\t\tseries.push(out);\n\t\t}\n\t}\n\tif (!types.length) {\n\t\tissues.push({ path: 'plotArea', message: unsupported.length ? `The chart type is not supported: ${unsupported.join(', ')}.` : 'The chart has no plot groups.' });\n\t\treturn { spec: normalizeChartSpec(input).spec, issues, unsupported, lossless: false };\n\t}\n\tconst first = types[0];\n\tconst combo = types.some((t) => t !== first);\n\tinput.type = combo ? (types.includes('bar') ? 'bar' : first) : first;\n\tif (!combo) for (const s of series) delete s.type;\n\telse for (const s of series) if (s.type === input.type) delete s.type;\n\tif (!combo) for (const s of series) if (s.axis) issues.push({ path: 'series', message: `\"${s.name}\" is on a second value axis.` });\n\tif (types.some((t) => !isCartesianChart(t)) && combo) unsupported.push('a pie or radar mixed with other chart types');\n\tinput.series = series;\n\tinput.categories = categories.length ? categories : Array.from({ length: Math.max(0, ...series.map((s) => s.values.length)) }, (_, i) => `${i + 1}`);\n\tinput.stacking = stacking;\n\tinput.orientation = orientation;\n\tinput.dataLabels = dataLabels;\n\tinput.points = points || first !== 'line';\n\tif (bool(val(groups[0], 'varyColors')) && (first === 'bar' || first === 'line') && series.length === 1) unsupported.push('one colour per point (vary colours)');\n\n\t// Axes\n\tconst readAxis = (a: Element | undefined, fallback: ChartAxis): ChartAxis => {\n\t\tconst axis: ChartAxis = { ...fallback, format: {} };\n\t\tif (!a) return axis;\n\t\taxis.show = !bool(val(a, 'delete'));\n\t\taxis.title = richText(kid(a, 'title')) ?? '';\n\t\taxis.gridlines = !!kid(a, 'majorGridlines');\n\t\tconst scaling = kid(a, 'scaling');\n\t\taxis.min = numberOf(val(scaling, 'min'));\n\t\taxis.max = numberOf(val(scaling, 'max'));\n\t\tif (val(scaling, 'orientation') === 'maxMin') unsupported.push('a reversed axis');\n\t\tif (kid(scaling, 'logBase')) unsupported.push('a logarithmic axis');\n\t\taxis.step = numberOf(val(a, 'majorUnit'));\n\t\tconst fmt = kid(a, 'numFmt');\n\t\tconst code = fmt?.getAttribute('formatCode');\n\t\tif (code && code !== 'General' && fmt?.getAttribute('sourceLinked') !== '1') axis.format = { code };\n\t\treturn axis;\n\t};\n\tconst xy = first === 'scatter' || first === 'bubble';\n\tconst catAxis = kid(plot, 'catAx') ?? kid(plot, 'dateAx') ?? (xy ? valAxes.find((a) => !vertical(a)) : undefined);\n\tinput.xAxis = readAxis(catAxis, defaultChartAxis(false));\n\tif (kid(plot, 'dateAx')) (input.xAxis as ChartAxis).kind = 'date';\n\tinput.yAxis = readAxis(primaryAxis ?? valAxes.find(vertical) ?? valAxes[0], defaultChartAxis(true));\n\tconst secondaryAxis = valAxes.find((a) => a !== primaryAxis && (xy ? vertical(a) && a !== primaryAxis : true) && a !== catAxis);\n\tif (series.some((s) => s.axis === 'secondary') && secondaryAxis) input.yAxis2 = readAxis(secondaryAxis, defaultChartAxis(false));\n\tconst { spec, issues: specIssues } = normalizeChartSpec(input);\n\tissues.push(...specIssues);\n\tconst uniq = [...new Set(unsupported)];\n\treturn { spec, issues, unsupported: uniq, lossless: uniq.length === 0 && specIssues.length === 0 };\n}\n\nfunction readChartex(root: Element, issues: ChartIssue[], unsupported: string[]): ChartOoxmlReadResult {\n\tconst data = new Map<string, { categories: string[]; values: ChartValue[]; code?: string }>();\n\tfor (const d of kids(kid(root, 'chartData'), 'data')) {\n\t\tconst id = d.getAttribute('id') ?? String(data.size);\n\t\tconst strDim = kids(d, 'strDim')[0];\n\t\tconst numDim = kids(d, 'numDim')[0];\n\t\tconst lvl = (dim: Element | undefined) => kids(dim, 'lvl')[0];\n\t\tconst cats = kids(lvl(strDim), 'pt').map((p) => p.textContent ?? '');\n\t\tconst values: ChartValue[] = [];\n\t\tconst nl = lvl(numDim);\n\t\tfor (const p of kids(nl, 'pt')) {\n\t\t\tconst i = Number(p.getAttribute('idx') ?? values.length);\n\t\t\twhile (values.length < i) values.push(null);\n\t\t\tvalues[i] = numberOf((p.textContent ?? '').trim());\n\t\t}\n\t\tdata.set(id, { categories: cats, values, code: nl?.getAttribute('formatCode') ?? undefined });\n\t}\n\tconst chart = kid(root, 'chart');\n\tconst region = path(chart, 'plotArea', 'plotAreaRegion');\n\tconst seriesEls = kids(region, 'series');\n\tconst layouts: Record<string, ChartType> = { waterfall: 'waterfall', funnel: 'funnel', treemap: 'treemap', sunburst: 'treemap', boxWhisker: 'box', clusteredColumn: 'histogram', paretoLine: 'histogram' };\n\tconst layout = seriesEls[0]?.getAttribute('layoutId') ?? '';\n\tconst type = layouts[layout];\n\tif (!type) {\n\t\tissues.push({ path: 'plotArea', message: `The chart layout \"${layout || 'unknown'}\" is not supported.` });\n\t\treturn { spec: normalizeChartSpec({}).spec, issues, unsupported: [layout || 'unknown chartex layout'], lossless: false };\n\t}\n\tif (layout === 'sunburst') unsupported.push('sunburst (drawn as a treemap of the innermost level)');\n\tif (layout === 'paretoLine') unsupported.push('pareto line');\n\tconst series: ChartSeries[] = [];\n\tlet categories: string[] = [];\n\tfor (const s of seriesEls) {\n\t\tif (s.getAttribute('layoutId') === 'paretoLine') continue;\n\t\tconst ref = kid(s, 'dataId')?.getAttribute('val') ?? '0';\n\t\tconst d = data.get(ref);\n\t\tif (!d) continue;\n\t\tif (!categories.length) categories = d.categories;\n\t\tconst out: ChartSeries = { id: `series-${series.length + 1}`, name: strings(kid(s, 'tx'))[0] ?? `Series ${series.length + 1}`, values: d.values };\n\t\tif (d.code && d.code !== 'General') out.format = { code: d.code };\n\t\tseries.push(out);\n\t}\n\tconst title = richText(kid(chart, 'title'));\n\tconst longest = Math.max(0, ...series.map((s) => s.values.length));\n\tconst input: Record<string, unknown> = {\n\t\ttype,\n\t\ttitle: title ?? '',\n\t\tseries,\n\t\tcategories: categories.length >= longest ? categories : Array.from({ length: longest }, (_, i) => categories[i] ?? `${i + 1}`)\n\t};\n\tif (type === 'waterfall') input.showTotal = false;\n\tconst { spec, issues: specIssues } = normalizeChartSpec(input);\n\tissues.push(...specIssues);\n\treturn { spec, issues, unsupported, lossless: unsupported.length === 0 && specIssues.length === 0 };\n}\n\n// ---------------------------------------------------------------------------\n// Writing\n// ---------------------------------------------------------------------------\n\nconst esc = (s: string) => s.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/\"/g, '"');\nconst hex = (color: string | undefined) => {\n\tif (!color) return null;\n\tconst rgb = parseChartColor(color);\n\treturn rgb ? chartRgbToHex(rgb).slice(1).toUpperCase() : null;\n};\nconst fillXml = (color: string | undefined, line = false) => {\n\tconst h = hex(color);\n\tif (!h) return '';\n\treturn line ? `<c:spPr><a:ln w=\"28575\" cap=\"rnd\"><a:solidFill><a:srgbClr val=\"${h}\"/></a:solidFill><a:round/></a:ln></c:spPr>` : `<c:spPr><a:solidFill><a:srgbClr val=\"${h}\"/></a:solidFill></c:spPr>`;\n};\nconst rich = (text: string) => `<c:tx><c:rich><a:bodyPr/><a:lstStyle/><a:p><a:r><a:t>${esc(text)}</a:t></a:r></a:p></c:rich></c:tx><c:overlay val=\"0\"/>`;\nconst strLit = (items: readonly string[]) => `<c:strLit><c:ptCount val=\"${items.length}\"/>${items.map((s, i) => `<c:pt idx=\"${i}\"><c:v>${esc(s)}</c:v></c:pt>`).join('')}</c:strLit>`;\nconst numLit = (items: readonly ChartValue[], code = 'General') =>\n\t`<c:numLit><c:formatCode>${esc(code)}</c:formatCode><c:ptCount val=\"${items.length}\"/>${items.map((v, i) => (v === null || !Number.isFinite(v) ? '' : `<c:pt idx=\"${i}\"><c:v>${v}</c:v></c:pt>`)).join('')}</c:numLit>`;\n\nconst CURRENCY_SYMBOL: Record<string, string> = { USD: '$', EUR: '€', GBP: '£', JPY: '¥', CNY: '¥', INR: '₹' };\n\n/** A spreadsheet format code equivalent to a chart number format (`General` when there is none). */\nexport function chartFormatToCode(format: ChartNumberFormat): string {\n\tif (format.code) return format.code;\n\tconst d = format.decimals;\n\tconst frac = (n: number | undefined, fallback: number) => {\n\t\tconst k = n ?? fallback;\n\t\treturn k > 0 ? `.${'0'.repeat(k)}` : '';\n\t};\n\tconst wrap = (body: string) => `${format.prefix ? `\"${format.prefix.replace(/\"/g, '')}\"` : ''}${body}${format.suffix ? `\"${format.suffix.replace(/\"/g, '')}\"` : ''}`;\n\tswitch (format.style) {\n\t\tcase 'percent':\n\t\t\treturn wrap(`#,##0${frac(d, 0)}%`);\n\t\tcase 'currency': {\n\t\t\tconst code = (format.currency || 'USD').toUpperCase();\n\t\t\tconst sym = CURRENCY_SYMBOL[code] ?? `${code} `;\n\t\t\treturn wrap(`\"${sym}\"#,##0${frac(d, 0)}`);\n\t\t}\n\t\tcase 'compact':\n\t\t\treturn wrap('#,##0.0,,\"M\"');\n\t\tdefault:\n\t\t\treturn d !== undefined || format.prefix || format.suffix ? wrap(`#,##0${frac(d, 0)}`) : 'General';\n\t}\n}\n\nconst MARKER_OUT: Record<ChartMarker, string> = { circle: 'circle', square: 'square', diamond: 'diamond', triangle: 'triangle', cross: 'x', none: 'none' };\n\nexport interface ChartOoxmlWriteResult {\n\t/** The `c:chartSpace` part. */\n\txml: string;\n\t/** What could not be written as DrawingML, as sentences (empty when nothing was lost). */\n\tissues: string[];\n}\n\n/**\n * Writes a chart as a DrawingML chart part (`c:chartSpace`) with the data as literals (no\n * embedded workbook), for `word/charts/chartN.xml` or `ppt/charts/chartN.xml`. Waterfall,\n * histogram, box, funnel and treemap charts need Office 2016 chartex parts; they are written\n * as the closest classic chart and reported in `issues`.\n */\nexport function chartToOoxml(spec: ChartSpec): ChartOoxmlWriteResult {\n\tconst issues: string[] = [];\n\tconst family = chartFamily(spec);\n\tlet type = spec.type;\n\tif (family === 'waterfall' || family === 'histogram' || family === 'box' || family === 'funnel') {\n\t\tissues.push(`${spec.type} charts are written as bar charts: DrawingML has no ${spec.type} type (Office 2016 stores it as chartex).`);\n\t\ttype = 'bar';\n\t} else if (family === 'treemap') {\n\t\tissues.push('Treemaps are written as pie charts: DrawingML has no treemap type.');\n\t\ttype = 'pie';\n\t}\n\tconst visible = spec.series.filter((s) => !s.hidden);\n\tif (visible.length < spec.series.length) issues.push(`${spec.series.length - visible.length} hidden series ${spec.series.length - visible.length === 1 ? 'is' : 'are'} left out.`);\n\tconst grouping = spec.stacking === 'stacked' ? 'stacked' : spec.stacking === 'percent' ? 'percentStacked' : 'standard';\n\tconst ids = { cat: 500000001, val: 500000002, cat2: 500000003, val2: 500000004 };\n\tconst xy = family === 'xy' || type === 'scatter' || type === 'bubble';\n\tconst pieLike = type === 'pie' || type === 'donut';\n\tconst typed = (s: ChartSeries) => (pieLike || type === 'radar' ? type : type === 'bubble' ? 'bubble' : xy ? 'scatter' : chartSeriesType({ type }, s));\n\t// Groups: (kind, axis) in first-appearance order.\n\tconst groups: { kind: string; secondary: boolean; series: { s: ChartSeries; index: number }[] }[] = [];\n\tvisible.forEach((s) => {\n\t\tconst kind = typed(s);\n\t\tconst secondary = !pieLike && s.axis === 'secondary';\n\t\tlet g = groups.find((x) => x.kind === kind && x.secondary === secondary);\n\t\tif (!g) groups.push((g = { kind, secondary, series: [] }));\n\t\tg.series.push({ s, index: spec.series.indexOf(s) });\n\t});\n\tif (pieLike && visible.length > 1) issues.push('Only the first series of a pie is drawn; the others are kept in the part.');\n\tconst catLit = strLit(spec.categories);\n\tlet order = 0;\n\tconst serXml = (kind: string, s: ChartSeries, index: number) => {\n\t\tconst parts = [`<c:idx val=\"${index}\"/>`, `<c:order val=\"${order++}\"/>`, `<c:tx><c:v>${esc(s.name)}</c:v></c:tx>`];\n\t\tconst lineLike = kind === 'line' || kind === 'scatter' || kind === 'radar';\n\t\tparts.push(fillXml(s.color, lineLike));\n\t\tif (kind === 'bar' || kind === 'bubble') parts.push('<c:invertIfNegative val=\"0\"/>');\n\t\tif (lineLike) {\n\t\t\tconst marker = s.marker ?? (spec.points || kind === 'scatter' ? 'circle' : 'none');\n\t\t\tparts.push(`<c:marker><c:symbol val=\"${MARKER_OUT[marker]}\"/>${marker !== 'none' ? '<c:size val=\"5\"/>' : ''}</c:marker>`);\n\t\t}\n\t\t(s.pointColors ?? []).forEach((c, i) => {\n\t\t\tconst h = hex(c ?? undefined);\n\t\t\tif (h) parts.push(`<c:dPt><c:idx val=\"${i}\"/>${kind === 'bar' ? '<c:invertIfNegative val=\"0\"/>' : ''}<c:bubble3D val=\"0\"/><c:spPr><a:solidFill><a:srgbClr val=\"${h}\"/></a:solidFill></c:spPr></c:dPt>`);\n\t\t});\n\t\tconst labels = s.dataLabels ?? spec.dataLabels;\n\t\tconst code = s.format ? chartFormatToCode(s.format) : undefined;\n\t\tif (s.dataLabels !== undefined || code)\n\t\t\tparts.push(`<c:dLbls>${code ? `<c:numFmt formatCode=\"${esc(code)}\" sourceLinked=\"0\"/>` : ''}<c:showLegendKey val=\"0\"/><c:showVal val=\"${labels ? 1 : 0}\"/><c:showCatName val=\"0\"/><c:showSerName val=\"0\"/><c:showPercent val=\"0\"/><c:showBubbleSize val=\"0\"/></c:dLbls>`);\n\t\tif (!pieLike && kind !== 'radar')\n\t\t\tfor (const t of s.trendlines ?? []) {\n\t\t\t\tlet x = `<c:trendline>${t.name ? `<c:name>${esc(t.name)}</c:name>` : ''}${fillXml(t.color, true)}<c:trendlineType val=\"${TREND_OUT[t.type]}\"/>`;\n\t\t\t\tif (t.type === 'polynomial') x += `<c:order val=\"${t.order ?? 2}\"/>`;\n\t\t\t\tif (t.type === 'moving-average') x += `<c:period val=\"${t.period ?? 2}\"/>`;\n\t\t\t\tif (t.forward) x += `<c:forward val=\"${t.forward}\"/>`;\n\t\t\t\tif (t.backward) x += `<c:backward val=\"${t.backward}\"/>`;\n\t\t\t\tif (t.intercept !== undefined && t.intercept !== null) x += `<c:intercept val=\"${t.intercept}\"/>`;\n\t\t\t\tx += `<c:dispRSqr val=\"${t.showR2 ? 1 : 0}\"/><c:dispEq val=\"${t.showEquation ? 1 : 0}\"/></c:trendline>`;\n\t\t\t\tparts.push(x);\n\t\t\t}\n\t\tconst valCode = chartFormatToCode(s.format ?? (s.axis === 'secondary' ? spec.yAxis2.format : spec.yAxis.format));\n\t\tif (kind === 'scatter' || kind === 'bubble') {\n\t\t\tconst xs = s.x ?? spec.categories.map((_, i) => i + 1);\n\t\t\tparts.push(`<c:xVal>${numLit(xs)}</c:xVal><c:yVal>${numLit(s.values, valCode)}</c:yVal>`);\n\t\t\tif (kind === 'bubble') parts.push(`<c:bubbleSize>${numLit(s.sizes ?? s.values.map(() => 1))}</c:bubbleSize><c:bubble3D val=\"0\"/>`);\n\t\t\telse parts.push(`<c:smooth val=\"${(s.curve ?? spec.curve) === 'smooth' ? 1 : 0}\"/>`);\n\t\t} else {\n\t\t\tparts.push(`<c:cat>${catLit}</c:cat><c:val>${numLit(s.values, valCode)}</c:val>`);\n\t\t\tif (kind === 'line') parts.push(`<c:smooth val=\"${(s.curve ?? spec.curve) === 'smooth' ? 1 : 0}\"/>`);\n\t\t}\n\t\tif ((s.curve ?? spec.curve) === 'step' && lineLike) issues.push(`\"${s.name}\" uses step lines, which DrawingML cannot express; they are written straight.`);\n\t\tif ((s.curve ?? spec.curve) === 'smooth' && kind === 'area') issues.push(`\"${s.name}\" is a smoothed area, which DrawingML cannot express; it is written straight.`);\n\t\treturn `<c:ser>${parts.join('')}</c:ser>`;\n\t};\n\tconst dLbls = `<c:dLbls><c:showLegendKey val=\"0\"/><c:showVal val=\"${spec.dataLabels ? 1 : 0}\"/><c:showCatName val=\"0\"/><c:showSerName val=\"0\"/><c:showPercent val=\"0\"/><c:showBubbleSize val=\"0\"/></c:dLbls>`;\n\tconst groupXml = groups.map((g) => {\n\t\tconst axes = g.secondary ? `<c:axId val=\"${ids.cat2}\"/><c:axId val=\"${ids.val2}\"/>` : `<c:axId val=\"${ids.cat}\"/><c:axId val=\"${ids.val}\"/>`;\n\t\tconst sers = g.series.map(({ s, index }) => serXml(g.kind, s, index)).join('');\n\t\tswitch (g.kind) {\n\t\t\tcase 'bar': {\n\t\t\t\tconst n = g.series.length;\n\t\t\t\tconst barsWidth = spec.stacking === 'none' ? n - (n - 1) * spec.overlap : 1;\n\t\t\t\tconst gapPct = Math.round(Math.min(500, (spec.gapWidth / Math.max(0.01, 1 - spec.gapWidth)) * barsWidth * 100));\n\t\t\t\tconst overlapPct = spec.stacking === 'none' ? Math.round(spec.overlap * 100) : 100;\n\t\t\t\treturn `<c:barChart><c:barDir val=\"${spec.orientation === 'horizontal' ? 'bar' : 'col'}\"/><c:grouping val=\"${spec.stacking === 'none' ? 'clustered' : grouping}\"/><c:varyColors val=\"0\"/>${sers}${dLbls}<c:gapWidth val=\"${gapPct}\"/><c:overlap val=\"${overlapPct}\"/>${axes}</c:barChart>`;\n\t\t\t}\n\t\t\tcase 'line':\n\t\t\t\treturn `<c:lineChart><c:grouping val=\"${spec.stacking === 'none' ? 'standard' : 'standard'}\"/><c:varyColors val=\"0\"/>${sers}${dLbls}<c:marker val=\"1\"/>${axes}</c:lineChart>`;\n\t\t\tcase 'area':\n\t\t\t\treturn `<c:areaChart><c:grouping val=\"${grouping}\"/><c:varyColors val=\"0\"/>${sers}${dLbls}${axes}</c:areaChart>`;\n\t\t\tcase 'scatter':\n\t\t\t\treturn `<c:scatterChart><c:scatterStyle val=\"lineMarker\"/><c:varyColors val=\"0\"/>${sers}${dLbls}${axes}</c:scatterChart>`;\n\t\t\tcase 'bubble':\n\t\t\t\treturn `<c:bubbleChart><c:varyColors val=\"0\"/>${sers}${dLbls}<c:bubbleScale val=\"100\"/>${axes}</c:bubbleChart>`;\n\t\t\tcase 'radar':\n\t\t\t\treturn `<c:radarChart><c:radarStyle val=\"marker\"/><c:varyColors val=\"0\"/>${sers}${dLbls}${axes}</c:radarChart>`;\n\t\t\tcase 'donut':\n\t\t\t\treturn `<c:doughnutChart><c:varyColors val=\"1\"/>${sers}${dLbls}<c:firstSliceAng val=\"0\"/><c:holeSize val=\"${Math.round(Math.max(10, Math.min(90, spec.innerRadius * 100)))}\"/></c:doughnutChart>`;\n\t\t\tdefault:\n\t\t\t\treturn `<c:pieChart><c:varyColors val=\"1\"/>${sers}${dLbls}<c:firstSliceAng val=\"0\"/></c:pieChart>`;\n\t\t}\n\t});\n\tconst scaling = (a: ChartAxis) => `<c:scaling><c:orientation val=\"minMax\"/>${a.max !== null ? `<c:max val=\"${a.max}\"/>` : ''}${a.min !== null ? `<c:min val=\"${a.min}\"/>` : ''}</c:scaling>`;\n\tconst title = (a: ChartAxis) => (a.title ? `<c:title>${rich(a.title)}</c:title>` : '');\n\tconst fmt = (a: ChartAxis) => {\n\t\tconst code = chartFormatToCode(a.format);\n\t\treturn code !== 'General' ? `<c:numFmt formatCode=\"${esc(code)}\" sourceLinked=\"0\"/>` : `<c:numFmt formatCode=\"${spec.stacking === 'percent' ? '0%' : 'General'}\" sourceLinked=\"1\"/>`;\n\t};\n\tconst horizontal = spec.orientation === 'horizontal';\n\tconst catPos = horizontal ? 'l' : 'b';\n\tconst valPos = horizontal ? 'b' : 'l';\n\tconst valAx = (id: number, cross: number, a: ChartAxis, pos: string, crosses: string, catKind = false) =>\n\t\t`<c:valAx><c:axId val=\"${id}\"/>${scaling(a)}<c:delete val=\"${a.show ? 0 : 1}\"/><c:axPos val=\"${pos}\"/>${a.gridlines ? '<c:majorGridlines/>' : ''}${title(a)}${fmt(a)}<c:majorTickMark val=\"out\"/><c:minorTickMark val=\"none\"/><c:tickLblPos val=\"nextTo\"/><c:crossAx val=\"${cross}\"/><c:crosses val=\"${crosses}\"/><c:crossBetween val=\"${catKind ? 'midCat' : 'between'}\"/>${a.step ? `<c:majorUnit val=\"${a.step}\"/>` : ''}</c:valAx>`;\n\tconst catAx = (id: number, cross: number, a: ChartAxis, pos: string, hidden = false) =>\n\t\t`<c:${a.kind === 'date' ? 'dateAx' : 'catAx'}><c:axId val=\"${id}\"/><c:scaling><c:orientation val=\"minMax\"/></c:scaling><c:delete val=\"${a.show && !hidden ? 0 : 1}\"/><c:axPos val=\"${pos}\"/>${a.gridlines ? '<c:majorGridlines/>' : ''}${title(a)}<c:numFmt formatCode=\"General\" sourceLinked=\"1\"/><c:majorTickMark val=\"out\"/><c:minorTickMark val=\"none\"/><c:tickLblPos val=\"nextTo\"/><c:crossAx val=\"${cross}\"/><c:crosses val=\"autoZero\"/><c:auto val=\"1\"/>${a.kind === 'date' ? '<c:lblOffset val=\"100\"/><c:baseTimeUnit val=\"days\"/>' : '<c:lblAlgn val=\"ctr\"/><c:lblOffset val=\"100\"/><c:noMultiLvlLbl val=\"0\"/>'}</c:${a.kind === 'date' ? 'dateAx' : 'catAx'}>`;\n\tlet axes = '';\n\tif (!pieLike) {\n\t\tif (xy) axes = valAx(ids.cat, ids.val, spec.xAxis, 'b', 'autoZero', true) + valAx(ids.val, ids.cat, spec.yAxis, 'l', 'autoZero', true);\n\t\telse axes = catAx(ids.cat, ids.val, spec.xAxis, catPos) + valAx(ids.val, ids.cat, spec.yAxis, valPos, 'autoZero');\n\t\tif (groups.some((g) => g.secondary)) axes += catAx(ids.cat2, ids.val2, spec.xAxis, catPos, true) + valAx(ids.val2, ids.cat2, spec.yAxis2, horizontal ? 't' : 'r', 'max');\n\t}\n\tconst legendPos = { bottom: 'b', top: 't', left: 'l', right: 'r' }[spec.legend.position];\n\tconst legend = spec.legend.show ? `<c:legend><c:legendPos val=\"${legendPos}\"/><c:overlay val=\"0\"/></c:legend>` : '';\n\tconst titleXml = spec.title ? `<c:title>${rich(spec.title)}</c:title><c:autoTitleDeleted val=\"0\"/>` : '<c:autoTitleDeleted val=\"1\"/>';\n\tif (spec.subtitle) issues.push('The subtitle is left out: DrawingML charts have one title.');\n\tif (family === 'radar' && spec.series.some((s) => s.trendlines?.length)) issues.push('Trendlines on a radar chart are left out.');\n\tconst xml =\n\t\t`<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>` +\n\t\t`<c:chartSpace xmlns:c=\"${CHART_OOXML_NS}\" xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\">` +\n\t\t`<c:roundedCorners val=\"0\"/><c:chart>${titleXml}<c:plotArea><c:layout/>${groupXml.join('')}${axes}</c:plotArea>${legend}<c:plotVisOnly val=\"1\"/><c:dispBlanksAs val=\"gap\"/></c:chart>` +\n\t\t`<c:txPr><a:bodyPr/><a:lstStyle/><a:p><a:pPr><a:defRPr sz=\"${Math.round(10 * 100)}\"/></a:pPr><a:endParaRPr lang=\"en-US\"/></a:p></c:txPr></c:chartSpace>`;\n\treturn { xml, issues: [...new Set(issues)] };\n}\n"]}
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
CHART_STACKINGS,
|
|
11
11
|
CHART_TRENDLINE_TYPES,
|
|
12
12
|
CHART_TYPES
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-OV7UAKIY.js";
|
|
14
14
|
|
|
15
15
|
// src/chart/schemas.ts
|
|
16
16
|
var VALUE = { type: ["number", "string", "null"], description: 'A number, numeric text ("1,200", "12%", "$40", "(3)") or null for a gap.' };
|
|
@@ -110,4 +110,4 @@ export {
|
|
|
110
110
|
SERIES_PROPS,
|
|
111
111
|
CHART_UPDATE_PROPERTIES
|
|
112
112
|
};
|
|
113
|
-
//# sourceMappingURL=chunk-
|
|
113
|
+
//# sourceMappingURL=chunk-5TWIN7ZJ.js.map
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
import {
|
|
9
9
|
CHART_OOXML_NS,
|
|
10
10
|
chartFromOoxml
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-GJBIVWB2.js";
|
|
12
12
|
import {
|
|
13
13
|
Chart,
|
|
14
14
|
MAX_TABLE_COLUMNS,
|
|
@@ -32,10 +32,10 @@ import {
|
|
|
32
32
|
searchDocument,
|
|
33
33
|
sliceContainsTable,
|
|
34
34
|
syncInitialContent
|
|
35
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-QFTVLEVN.js";
|
|
36
36
|
import {
|
|
37
37
|
chartDataToTable
|
|
38
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-OV7UAKIY.js";
|
|
39
39
|
import {
|
|
40
40
|
compareDocuments
|
|
41
41
|
} from "./chunk-QJSOZFCZ.js";
|
|
@@ -6753,4 +6753,4 @@ export {
|
|
|
6753
6753
|
validateFindPattern,
|
|
6754
6754
|
createTableCommands
|
|
6755
6755
|
};
|
|
6756
|
-
//# sourceMappingURL=chunk-
|
|
6756
|
+
//# sourceMappingURL=chunk-DQPBQXKG.js.map
|
|
@@ -6,9 +6,11 @@
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
|
+
var _chunkGTZXF4BIcjs = require('./chunk-GTZXF4BI.cjs');
|
|
9
10
|
|
|
10
11
|
|
|
11
|
-
|
|
12
|
+
|
|
13
|
+
var _chunkJOX6MJW4cjs = require('./chunk-JOX6MJW4.cjs');
|
|
12
14
|
|
|
13
15
|
|
|
14
16
|
var _chunkIFHKKVXHcjs = require('./chunk-IFHKKVXH.cjs');
|
|
@@ -1202,7 +1204,7 @@ var ChartNodeView = (_class = class {
|
|
|
1202
1204
|
this.dom.contentEditable = "false";
|
|
1203
1205
|
this.syncAttributes();
|
|
1204
1206
|
this.key = specKey(this.node.attrs.spec);
|
|
1205
|
-
this.controller = new (0,
|
|
1207
|
+
this.controller = new (0, _chunkGTZXF4BIcjs.ChartController)({ spec: this.node.attrs.spec });
|
|
1206
1208
|
this.unsubscribe = this.controller.subscribe((state) => {
|
|
1207
1209
|
if (!state.gesture) this.writeBack();
|
|
1208
1210
|
});
|
|
@@ -1435,7 +1437,7 @@ function readSpec(value) {
|
|
|
1435
1437
|
}
|
|
1436
1438
|
}
|
|
1437
1439
|
if (!input || typeof input !== "object" || Array.isArray(input)) return null;
|
|
1438
|
-
return
|
|
1440
|
+
return _chunkJOX6MJW4cjs.normalizeChartSpec.call(void 0, input).spec;
|
|
1439
1441
|
}
|
|
1440
1442
|
var readSize = (value) => {
|
|
1441
1443
|
const n = value === null ? NaN : Number(value);
|
|
@@ -1461,10 +1463,10 @@ function staticChartSvg(node, options) {
|
|
|
1461
1463
|
const spec = node.attrs.spec;
|
|
1462
1464
|
const width = _nullishCoalesce(node.attrs.width, () => ( options.defaultWidth));
|
|
1463
1465
|
const height = _nullishCoalesce(node.attrs.height, () => ( options.defaultHeight));
|
|
1464
|
-
const scene =
|
|
1465
|
-
return
|
|
1466
|
+
const scene = _chunkGTZXF4BIcjs.layoutChart.call(void 0, spec, { width, height, theme: options.theme, selection: null });
|
|
1467
|
+
return _chunkGTZXF4BIcjs.chartSceneToDomSpec.call(void 0, scene, {
|
|
1466
1468
|
ariaLabel: spec.title || "Chart",
|
|
1467
|
-
description:
|
|
1469
|
+
description: _chunkGTZXF4BIcjs.describeChart.call(void 0, spec),
|
|
1468
1470
|
attrs: { style: "max-width: 100%; height: auto; display: block" }
|
|
1469
1471
|
});
|
|
1470
1472
|
}
|
|
@@ -1480,7 +1482,7 @@ var Chart = _core.Node.create({
|
|
|
1480
1482
|
return {
|
|
1481
1483
|
HTMLAttributes: {},
|
|
1482
1484
|
nodeView: null,
|
|
1483
|
-
theme:
|
|
1485
|
+
theme: _chunkJOX6MJW4cjs.DEFAULT_CHART_THEME,
|
|
1484
1486
|
defaultWidth: 640,
|
|
1485
1487
|
defaultHeight: 320,
|
|
1486
1488
|
generateId: () => generateStructureId("chart")
|
|
@@ -1494,7 +1496,7 @@ var Chart = _core.Node.create({
|
|
|
1494
1496
|
renderHTML: (attributes) => attributes.id ? { "data-chart-id": attributes.id } : {}
|
|
1495
1497
|
},
|
|
1496
1498
|
spec: {
|
|
1497
|
-
default:
|
|
1499
|
+
default: _chunkJOX6MJW4cjs.normalizeChartSpec.call(void 0, {}).spec,
|
|
1498
1500
|
// null (no `data-chart`) keeps what the parse rule found, e.g. a mermaid block's spec.
|
|
1499
1501
|
parseHTML: (element) => readSpec(element.getAttribute("data-chart")),
|
|
1500
1502
|
renderHTML: (attributes) => ({
|
|
@@ -1532,7 +1534,7 @@ var Chart = _core.Node.create({
|
|
|
1532
1534
|
const code = element.querySelector("code");
|
|
1533
1535
|
const language = _nullishCoalesce(_nullishCoalesce(_optionalChain([code, 'optionalAccess', _33 => _33.getAttribute, 'call', _34 => _34("class")]), () => ( element.getAttribute("data-language"))), () => ( ""));
|
|
1534
1536
|
if (!/(?:^|\s)language-mermaid(?:\s|$)/.test(language) && language !== "mermaid") return false;
|
|
1535
|
-
const result =
|
|
1537
|
+
const result = _chunkGTZXF4BIcjs.chartFromMermaid.call(void 0, _nullishCoalesce((_nullishCoalesce(code, () => ( element))).textContent, () => ( "")));
|
|
1536
1538
|
return result.family ? { spec: result.spec } : false;
|
|
1537
1539
|
}
|
|
1538
1540
|
}
|
|
@@ -1556,7 +1558,7 @@ var Chart = _core.Node.create({
|
|
|
1556
1558
|
return {
|
|
1557
1559
|
markdown: {
|
|
1558
1560
|
serialize(state, node) {
|
|
1559
|
-
const text =
|
|
1561
|
+
const text = _chunkGTZXF4BIcjs.chartToMermaid.call(void 0, node.attrs.spec);
|
|
1560
1562
|
const fence = "`".repeat(Math.max(3, longestBacktickRun(text) + 1));
|
|
1561
1563
|
state.write(`${fence}mermaid
|
|
1562
1564
|
`);
|
|
@@ -1578,7 +1580,7 @@ var Chart = _core.Node.create({
|
|
|
1578
1580
|
type: this.name,
|
|
1579
1581
|
attrs: {
|
|
1580
1582
|
id: _nullishCoalesce(options.id, () => ( this.options.generateId())),
|
|
1581
|
-
spec:
|
|
1583
|
+
spec: _chunkJOX6MJW4cjs.normalizeChartSpec.call(void 0, _nullishCoalesce(options.spec, () => ( {}))).spec,
|
|
1582
1584
|
width: _nullishCoalesce(options.width, () => ( null)),
|
|
1583
1585
|
height: _nullishCoalesce(options.height, () => ( this.options.defaultHeight))
|
|
1584
1586
|
}
|
|
@@ -1589,7 +1591,7 @@ var Chart = _core.Node.create({
|
|
|
1589
1591
|
if (dispatch) {
|
|
1590
1592
|
tr.setNodeMarkup(chart.pos, void 0, {
|
|
1591
1593
|
...chart.node.attrs,
|
|
1592
|
-
...changes.spec !== void 0 ? { spec:
|
|
1594
|
+
...changes.spec !== void 0 ? { spec: _chunkJOX6MJW4cjs.normalizeChartSpec.call(void 0, changes.spec).spec } : {},
|
|
1593
1595
|
...changes.width !== void 0 ? { width: changes.width } : {},
|
|
1594
1596
|
...changes.height !== void 0 ? { height: changes.height } : {}
|
|
1595
1597
|
});
|
|
@@ -1696,14 +1698,14 @@ var Sparkline = _core.Node.create({
|
|
|
1696
1698
|
return [{ tag: 'span[data-type="sparkline"]', priority: 60 }];
|
|
1697
1699
|
},
|
|
1698
1700
|
renderHTML({ node, HTMLAttributes }) {
|
|
1699
|
-
const scene =
|
|
1701
|
+
const scene = _chunkGTZXF4BIcjs.layoutSparkline.call(void 0, node.attrs.values, {
|
|
1700
1702
|
kind: node.attrs.kind,
|
|
1701
1703
|
width: node.attrs.width,
|
|
1702
1704
|
height: node.attrs.height,
|
|
1703
1705
|
color: _nullishCoalesce(node.attrs.color, () => ( this.options.color)),
|
|
1704
1706
|
negativeColor: this.options.negativeColor
|
|
1705
1707
|
});
|
|
1706
|
-
const svg =
|
|
1708
|
+
const svg = _chunkGTZXF4BIcjs.chartSceneToDomSpec.call(void 0, scene, {
|
|
1707
1709
|
ariaLabel: sparklineLabel(node),
|
|
1708
1710
|
attrs: { style: "display: inline-block; vertical-align: middle" }
|
|
1709
1711
|
});
|
|
@@ -2055,4 +2057,4 @@ function createTableStore(editor) {
|
|
|
2055
2057
|
|
|
2056
2058
|
|
|
2057
2059
|
exports.ALLOW_NESTED_TABLES_META = ALLOW_NESTED_TABLES_META; exports.tableNestingPluginKey = tableNestingPluginKey; exports.outermostTableDepth = outermostTableDepth; exports.isInTableCell = isInTableCell; exports.sliceContainsTable = sliceContainsTable; exports.insertSliceAfterTable = insertSliceAfterTable; exports.handleTablePasteWithoutNesting = handleTablePasteWithoutNesting; exports.unnestTables = unnestTables; exports.createTableNestingPlugin = createTableNestingPlugin; exports.generateStructureId = generateStructureId; exports.presenceStateSpec = presenceStateSpec; exports.arraysEqual = arraysEqual; exports.scrollDomAtPos = scrollDomAtPos; exports.syncInitialContent = syncInitialContent; exports.STRUCTURE_PRIORITY = STRUCTURE_PRIORITY; exports.FIND_PARAGRAPH_MARK = FIND_PARAGRAPH_MARK; exports.MAX_FIND_PATTERN_LENGTH = MAX_FIND_PATTERN_LENGTH; exports.createSearchBudget = createSearchBudget; exports.foldCodePoint = foldCodePoint; exports.compileFindPattern = compileFindPattern; exports.findAllMatches = findAllMatches; exports.parseReplacement = parseReplacement; exports.expandReplacement = expandReplacement; exports.searchDocument = searchDocument; exports.applyReplacements = applyReplacements; exports.normalizeTableCellAlignment = normalizeTableCellAlignment; exports.normalizeTableCellColor = normalizeTableCellColor; exports.isGfmTable = isGfmTable; exports.DEFAULT_TABLE_OPTIONS = DEFAULT_TABLE_OPTIONS; exports.Table = Table; exports.TableRow = TableRow; exports.TableCell = TableCell; exports.TableHeader = TableHeader; exports.createTableExtensions = createTableExtensions; exports.ChartNodeView = ChartNodeView; exports.createChartNodeView = createChartNodeView; exports.chartPluginKey = chartPluginKey; exports.getDocumentCharts = getDocumentCharts; exports.isChartEnabled = isChartEnabled; exports.staticChartSvg = staticChartSvg; exports.Chart = Chart; exports.SPARKLINE_KINDS = SPARKLINE_KINDS; exports.MAX_SPARKLINE_VALUES = MAX_SPARKLINE_VALUES; exports.normalizeSparklineValues = normalizeSparklineValues; exports.sparklineLabel = sparklineLabel; exports.Sparkline = Sparkline; exports.TABLE_ACTIONS = TABLE_ACTIONS; exports.DEFAULT_TABLE_TOOLBAR = DEFAULT_TABLE_TOOLBAR; exports.MAX_TABLE_ROWS = MAX_TABLE_ROWS; exports.MAX_TABLE_COLUMNS = MAX_TABLE_COLUMNS; exports.isTableEnabled = isTableEnabled; exports.isSelectionInTable = isSelectionInTable; exports.shouldShowTableBubbleMenu = shouldShowTableBubbleMenu; exports.getTableActionState = getTableActionState; exports.runTableAction = runTableAction; exports.EMPTY_TABLE_STATE = EMPTY_TABLE_STATE; exports.getTableState = getTableState; exports.createTableStore = createTableStore;
|
|
2058
|
-
//# sourceMappingURL=chunk-
|
|
2060
|
+
//# sourceMappingURL=chunk-FEMIVHN3.cjs.map
|