allyhub 0.19.0 → 0.20.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/commands/align.js +1 -1
- package/dist/commands/check.js +1 -1
- package/dist/commands/cloud-tools.js +1 -1
- package/dist/commands/cloud.js +1 -1
- package/dist/commands/dev.js +5 -5
- package/dist/commands/export.js +3 -0
- package/dist/commands/frames/doc.js +1 -1
- package/dist/commands/frames/piece.js +1 -1
- package/dist/commands/frames/sheet.js +1 -1
- package/dist/commands/frames.js +9 -9
- package/dist/commands/index.js +1 -1
- package/dist/commands/inspect/combos.js +1 -1
- package/dist/commands/inspect/common.js +2 -2
- package/dist/commands/inspect/facts.js +2 -2
- package/dist/commands/migrate.js +3 -0
- package/dist/commands/skills.js +3 -3
- package/dist/commands/upgrade.js +5 -0
- package/dist/commands.json +1 -1
- package/dist/help.js +3 -3
- package/dist/main.js +8 -7
- package/dist/node_modules/@allyhub/3d-extension/package.json +2 -2
- package/dist/node_modules/@allyhub/audio/package.json +1 -1
- package/dist/node_modules/@allyhub/blocks/LICENSE +241 -0
- package/dist/node_modules/@allyhub/blocks/dist/alt.js +2 -0
- package/dist/node_modules/@allyhub/blocks/dist/elements.js +2 -0
- package/dist/node_modules/@allyhub/blocks/dist/flow-resolve.js +2 -0
- package/dist/node_modules/@allyhub/blocks/dist/flow-table.js +2 -0
- package/dist/node_modules/@allyhub/blocks/dist/format.js +2 -0
- package/dist/node_modules/@allyhub/blocks/dist/gantt.js +2 -0
- package/dist/node_modules/@allyhub/blocks/dist/grids.js +2 -0
- package/dist/node_modules/@allyhub/blocks/dist/html.js +75 -0
- package/dist/node_modules/@allyhub/blocks/dist/icons.generated.js +2 -0
- package/dist/node_modules/@allyhub/blocks/dist/icons.js +2 -0
- package/dist/node_modules/@allyhub/blocks/dist/index.js +2 -0
- package/dist/node_modules/@allyhub/blocks/dist/layout.js +2 -0
- package/dist/node_modules/@allyhub/blocks/dist/look.js +2 -0
- package/dist/node_modules/@allyhub/blocks/dist/measure.js +3 -0
- package/dist/node_modules/@allyhub/blocks/dist/model.js +2 -0
- package/dist/node_modules/@allyhub/blocks/dist/page.js +2 -0
- package/dist/node_modules/@allyhub/blocks/dist/palette.js +2 -0
- package/dist/node_modules/@allyhub/blocks/dist/path.js +2 -0
- package/dist/node_modules/@allyhub/blocks/dist/resolve.js +2 -0
- package/dist/node_modules/@allyhub/blocks/dist/samples.js +2 -0
- package/dist/node_modules/@allyhub/blocks/dist/sankey.js +2 -0
- package/dist/node_modules/@allyhub/blocks/dist/svg.js +2 -0
- package/dist/node_modules/@allyhub/blocks/dist/tidy.js +2 -0
- package/dist/node_modules/@allyhub/blocks/dist/trees.js +2 -0
- package/dist/node_modules/@allyhub/blocks/package.json +19 -0
- package/dist/node_modules/@allyhub/browser/dist/html.js +1 -1
- package/dist/node_modules/@allyhub/browser/package.json +1 -1
- package/dist/node_modules/@allyhub/build/dist/fonts.js +9 -3
- package/dist/node_modules/@allyhub/build/dist/index.js +1 -1
- package/dist/node_modules/@allyhub/build/dist/inspect-view.js +1 -1
- package/dist/node_modules/@allyhub/build/dist/migrate.js +2 -0
- package/dist/node_modules/@allyhub/build/dist/prepare.js +3 -3
- package/dist/node_modules/@allyhub/build/dist/work.js +3 -3
- package/dist/node_modules/@allyhub/build/package.json +5 -1
- package/dist/node_modules/@allyhub/canvas-extension/package.json +1 -1
- package/dist/node_modules/@allyhub/canvas-model/package.json +1 -1
- package/dist/node_modules/@allyhub/chart/dist/chart-file.js +2 -1
- package/dist/node_modules/@allyhub/chart/dist/chart-xml.js +4 -3
- package/dist/node_modules/@allyhub/chart/dist/chart.js +4 -2
- package/dist/node_modules/@allyhub/chart/dist/chartex-xml.js +4 -0
- package/dist/node_modules/@allyhub/chart/dist/classic.js +2 -0
- package/dist/node_modules/@allyhub/chart/dist/embedded.js +2 -2
- package/dist/node_modules/@allyhub/chart/dist/extended.js +2 -0
- package/dist/node_modules/@allyhub/chart/dist/index.js +1 -1
- package/dist/node_modules/@allyhub/chart/dist/svg.js +1 -1
- package/dist/node_modules/@allyhub/chart/dist/tree.js +2 -0
- package/dist/node_modules/@allyhub/chart/package.json +1 -1
- package/dist/node_modules/@allyhub/check/dist/check.js +1 -1
- package/dist/node_modules/@allyhub/check/package.json +1 -1
- package/dist/node_modules/@allyhub/cloud/dist/blobs.js +1 -1
- package/dist/node_modules/@allyhub/cloud/dist/call.js +4 -4
- package/dist/node_modules/@allyhub/cloud/dist/client.js +1 -1
- package/dist/node_modules/@allyhub/cloud/dist/storage.js +2 -0
- package/dist/node_modules/@allyhub/cloud/dist/uploads.js +2 -2
- package/dist/node_modules/@allyhub/cloud/package.json +1 -1
- package/dist/node_modules/@allyhub/components/package.json +1 -1
- package/dist/node_modules/@allyhub/dev-server/dist/background.js +1 -1
- package/dist/node_modules/@allyhub/dev-server/dist/item-process.js +2 -0
- package/dist/node_modules/@allyhub/dev-server/dist/item-worker.js +2 -0
- package/dist/node_modules/@allyhub/dev-server/dist/live.js +1 -1
- package/dist/node_modules/@allyhub/dev-server/dist/pages.js +20 -1
- package/dist/node_modules/@allyhub/dev-server/dist/project.js +1 -1
- package/dist/node_modules/@allyhub/dev-server/dist/record.js +1 -1
- package/dist/node_modules/@allyhub/dev-server/dist/server.js +2 -2
- package/dist/node_modules/@allyhub/dev-server/dist/tools.js +1 -1
- package/dist/node_modules/@allyhub/dev-server/dist/validate.js +2 -2
- package/dist/node_modules/@allyhub/dev-server/dist/writer.js +3 -3
- package/dist/node_modules/@allyhub/dev-server/package.json +1 -1
- package/dist/node_modules/@allyhub/diagnostics/dist/rules.js +1 -1
- package/dist/node_modules/@allyhub/diagnostics/package.json +1 -1
- package/dist/node_modules/@allyhub/doc/dist/blocks.js +2 -0
- package/dist/node_modules/@allyhub/doc/dist/chart.js +1 -1
- package/dist/node_modules/@allyhub/doc/dist/color.js +1 -1
- package/dist/node_modules/@allyhub/doc/dist/docx-read.js +12 -0
- package/dist/node_modules/@allyhub/doc/dist/docx.js +5 -4
- package/dist/node_modules/@allyhub/doc/dist/html.js +83 -48
- package/dist/node_modules/@allyhub/doc/dist/index.js +1 -1
- package/dist/node_modules/@allyhub/doc/dist/markdown.js +1 -1
- package/dist/node_modules/@allyhub/doc/dist/merges.js +2 -0
- package/dist/node_modules/@allyhub/doc/dist/model.js +1 -1
- package/dist/node_modules/@allyhub/doc/dist/numbering.js +2 -0
- package/dist/node_modules/@allyhub/doc/dist/omml.js +3 -0
- package/dist/node_modules/@allyhub/doc/dist/page.js +2 -1
- package/dist/node_modules/@allyhub/doc/dist/paper.js +1 -1
- package/dist/node_modules/@allyhub/doc/dist/parse.js +5 -4
- package/dist/node_modules/@allyhub/doc/dist/redline.js +2 -0
- package/dist/node_modules/@allyhub/doc/dist/revisions.js +2 -0
- package/dist/node_modules/@allyhub/doc/dist/shapes.js +4 -0
- package/dist/node_modules/@allyhub/doc/dist/styles.js +2 -0
- package/dist/node_modules/@allyhub/doc/dist/table.js +1 -1
- package/dist/node_modules/@allyhub/doc/dist/write.js +65 -39
- package/dist/node_modules/@allyhub/doc/package.json +5 -1
- package/dist/node_modules/@allyhub/doc-extension/dist/build.js +2 -2
- package/dist/node_modules/@allyhub/doc-extension/dist/cli/find.js +1 -1
- package/dist/node_modules/@allyhub/doc-extension/dist/cli/import.js +3 -0
- package/dist/node_modules/@allyhub/doc-extension/dist/cli/index.js +1 -1
- package/dist/node_modules/@allyhub/doc-extension/dist/cli/styles.js +4 -0
- package/dist/node_modules/@allyhub/doc-extension/dist/export.js +1 -1
- package/dist/node_modules/@allyhub/doc-extension/dist/inspect.js +1 -1
- package/dist/node_modules/@allyhub/doc-extension/dist/project-tools.js +1 -1
- package/dist/node_modules/@allyhub/doc-extension/dist/tools.js +1 -1
- package/dist/node_modules/@allyhub/doc-extension/package.json +22 -2
- package/dist/node_modules/@allyhub/doc-print/dist/drawn.js +4 -4
- package/dist/node_modules/@allyhub/doc-print/dist/index.js +1 -1
- package/dist/node_modules/@allyhub/doc-print/dist/layout.js +8 -7
- package/dist/node_modules/@allyhub/doc-print/dist/print.js +22 -16
- package/dist/node_modules/@allyhub/doc-print/package.json +1 -1
- package/dist/node_modules/@allyhub/export/dist/export.js +1 -1
- package/dist/node_modules/@allyhub/export/package.json +1 -1
- package/dist/node_modules/@allyhub/extension-api/package.json +1 -1
- package/dist/node_modules/@allyhub/extension-host/dist/points.js +1 -1
- package/dist/node_modules/@allyhub/extension-host/package.json +1 -1
- package/dist/node_modules/@allyhub/formats/dist/data/blocks-flow.js +2 -0
- package/dist/node_modules/@allyhub/formats/dist/data/blocks.d.ts +146 -0
- package/dist/node_modules/@allyhub/formats/dist/data/blocks.js +2 -0
- package/dist/node_modules/@allyhub/formats/dist/data/cell-styles.d.ts +9 -0
- package/dist/node_modules/@allyhub/formats/dist/data/cell-styles.js +2 -0
- package/dist/node_modules/@allyhub/formats/dist/data/deck-code.d.ts +47 -40
- package/dist/node_modules/@allyhub/formats/dist/data/deck-code.js +1 -1
- package/dist/node_modules/@allyhub/formats/dist/data/diagram-kinds.d.ts +6 -0
- package/dist/node_modules/@allyhub/formats/dist/data/diagram-kinds.js +2 -0
- package/dist/node_modules/@allyhub/formats/dist/data/diagrams.d.ts +29 -0
- package/dist/node_modules/@allyhub/formats/dist/data/diagrams.js +2 -0
- package/dist/node_modules/@allyhub/formats/dist/data/faces.d.ts +18 -0
- package/dist/node_modules/@allyhub/formats/dist/data/faces.js +1 -1
- package/dist/node_modules/@allyhub/formats/dist/data/page-data.d.ts +59 -0
- package/dist/node_modules/@allyhub/formats/dist/data/page-data.js +2 -0
- package/dist/node_modules/@allyhub/formats/dist/data/reference.d.ts +1 -1
- package/dist/node_modules/@allyhub/formats/dist/data/sheet.d.ts +698 -258
- package/dist/node_modules/@allyhub/formats/dist/data/sheet.js +1 -1
- package/dist/node_modules/@allyhub/formats/dist/data/slides.d.ts +14104 -2167
- package/dist/node_modules/@allyhub/formats/dist/data/slides.js +1 -1
- package/dist/node_modules/@allyhub/formats/dist/data/themes.d.ts +82 -0
- package/dist/node_modules/@allyhub/formats/dist/data/themes.js +2 -0
- package/dist/node_modules/@allyhub/formats/dist/data/tokens.d.ts +67 -0
- package/dist/node_modules/@allyhub/formats/dist/data/tokens.js +2 -0
- package/dist/node_modules/@allyhub/formats/dist/data/work.d.ts +42 -0
- package/dist/node_modules/@allyhub/formats/dist/data/work.js +1 -1
- package/dist/node_modules/@allyhub/formats/dist/index.d.ts +7 -0
- package/dist/node_modules/@allyhub/formats/dist/index.js +1 -1
- package/dist/node_modules/@allyhub/formats/dist/items.d.ts +12 -3
- package/dist/node_modules/@allyhub/formats/dist/schemas.d.ts +3260 -290
- package/dist/node_modules/@allyhub/formats/dist/schemas.js +1 -1
- package/dist/node_modules/@allyhub/formats/dist/tolerant.d.ts +45 -0
- package/dist/node_modules/@allyhub/formats/dist/tolerant.js +2 -0
- package/dist/node_modules/@allyhub/formats/package.json +1 -1
- package/dist/node_modules/@allyhub/html-extension/dist/project-tools.js +21 -9
- package/dist/node_modules/@allyhub/html-extension/dist/tools.js +1 -1
- package/dist/node_modules/@allyhub/html-extension/markup/allyhub.yaml +2 -0
- package/dist/node_modules/@allyhub/html-extension/markup/markup.json +14 -4
- package/dist/node_modules/@allyhub/html-extension/markup/pages/budget.html +22 -1
- package/dist/node_modules/@allyhub/html-extension/package.json +9 -1
- package/dist/node_modules/@allyhub/i18n/package.json +1 -1
- package/dist/node_modules/@allyhub/image-draw/dist/fonts.js +1 -1
- package/dist/node_modules/@allyhub/image-draw/dist/inspect.js +2 -2
- package/dist/node_modules/@allyhub/image-draw/package.json +1 -1
- package/dist/node_modules/@allyhub/image-extension/dist/build-plugins.js +1 -1
- package/dist/node_modules/@allyhub/image-extension/dist/cli.js +1 -1
- package/dist/node_modules/@allyhub/image-extension/package.json +2 -2
- package/dist/node_modules/@allyhub/image-extension/skills/allyhub/references/images.md +1 -1
- package/dist/node_modules/@allyhub/image-measure/dist/layout.js +2 -2
- package/dist/node_modules/@allyhub/image-measure/package.json +1 -1
- package/dist/node_modules/@allyhub/image-psd/package.json +1 -1
- package/dist/node_modules/@allyhub/image-render/package.json +1 -1
- package/dist/node_modules/@allyhub/image-runtime/package.json +1 -1
- package/dist/node_modules/@allyhub/image-sdk/dist/block.js +2 -0
- package/dist/node_modules/@allyhub/image-sdk/dist/blocks.js +2 -0
- package/dist/node_modules/@allyhub/image-sdk/dist/index.js +1 -1
- package/dist/node_modules/@allyhub/image-sdk/package.json +1 -1
- package/dist/node_modules/@allyhub/jobs/package.json +1 -1
- package/dist/node_modules/@allyhub/linkedin-extension/package.json +1 -3
- package/dist/node_modules/@allyhub/linkedin-extension/skills/allyhub/references/linkedin.md +3 -3
- package/dist/node_modules/@allyhub/linkedin-model/package.json +1 -1
- package/dist/node_modules/@allyhub/linkedin-view/package.json +1 -1
- package/dist/node_modules/@allyhub/measure/package.json +1 -1
- package/dist/node_modules/@allyhub/media/package.json +1 -1
- package/dist/node_modules/@allyhub/media-extension/dist/analyses/faces.js +1 -1
- package/dist/node_modules/@allyhub/media-extension/dist/asr/transcribe.js +1 -1
- package/dist/node_modules/@allyhub/media-extension/dist/ocr/text.js +1 -1
- package/dist/node_modules/@allyhub/media-extension/dist/vision/faces.js +1 -1
- package/dist/node_modules/@allyhub/media-extension/dist/vision/index-media.js +3 -2
- package/dist/node_modules/@allyhub/media-extension/package.json +1 -1
- package/dist/node_modules/@allyhub/model/package.json +1 -1
- package/dist/node_modules/@allyhub/office-extension/markup/csv/allyhub.yaml +2 -0
- package/dist/node_modules/@allyhub/office-extension/markup/csv/markup.json +1 -1
- package/dist/node_modules/@allyhub/office-extension/markup/document/allyhub.yaml +2 -0
- package/dist/node_modules/@allyhub/office-extension/markup/presentation/allyhub.yaml +2 -0
- package/dist/node_modules/@allyhub/office-extension/markup/workbook/allyhub.yaml +2 -0
- package/dist/node_modules/@allyhub/office-extension/markup/workbook/markup.json +1 -1
- package/dist/node_modules/@allyhub/office-extension/package.json +1 -1
- package/dist/node_modules/@allyhub/ooxml/dist/ext.js +1 -1
- package/dist/node_modules/@allyhub/ooxml/dist/mce.js +1 -1
- package/dist/node_modules/@allyhub/ooxml/dist/node.js +1 -1
- package/dist/node_modules/@allyhub/ooxml/dist/ns.js +1 -1
- package/dist/node_modules/@allyhub/ooxml/dist/opc.js +1 -1
- package/dist/node_modules/@allyhub/ooxml/package.json +1 -1
- package/dist/node_modules/@allyhub/piece/dist/export.d.ts +1 -1
- package/dist/node_modules/@allyhub/piece/dist/layout.d.ts +2 -0
- package/dist/node_modules/@allyhub/piece/dist/look.d.ts +10 -2
- package/dist/node_modules/@allyhub/piece/dist/look.js +1 -1
- package/dist/node_modules/@allyhub/piece/dist/media.d.ts +8 -2
- package/dist/node_modules/@allyhub/piece/dist/script.js +1 -1
- package/dist/node_modules/@allyhub/piece/dist/source.d.ts +3 -0
- package/dist/node_modules/@allyhub/piece/package.json +1 -1
- package/dist/node_modules/@allyhub/project/dist/media-index.js +1 -1
- package/dist/node_modules/@allyhub/project/package.json +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/cli.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/cloud.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/events.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/index.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/kinds.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/page-frame.js +2 -0
- package/dist/node_modules/@allyhub/protocol/package.json +1 -1
- package/dist/node_modules/@allyhub/registry/package.json +1 -1
- package/dist/node_modules/@allyhub/render/package.json +1 -1
- package/dist/node_modules/@allyhub/runtime/dist/footage.js +1 -1
- package/dist/node_modules/@allyhub/runtime/package.json +1 -1
- package/dist/node_modules/@allyhub/runtimes/dist/packages.js +2 -2
- package/dist/node_modules/@allyhub/runtimes/dist/runtimes.js +3 -3
- package/dist/node_modules/@allyhub/runtimes/package.json +1 -1
- package/dist/node_modules/@allyhub/scaffold/dist/index.js +12 -8
- package/dist/node_modules/@allyhub/scaffold/package.json +1 -1
- package/dist/node_modules/@allyhub/scenery/package.json +1 -1
- package/dist/node_modules/@allyhub/scenery-host/package.json +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/api/capabilities.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/api/charts.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/api/index.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/api/styles.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/api/workbook.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/calc/engine.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/calc/server.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/cell-styles.js +2 -0
- package/dist/node_modules/@allyhub/sheet/dist/chart.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/check.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/file.js +2 -2
- package/dist/node_modules/@allyhub/sheet/dist/heatmap.js +2 -0
- package/dist/node_modules/@allyhub/sheet/dist/html.js +10 -10
- package/dist/node_modules/@allyhub/sheet/dist/index.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/inspect.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/paginate.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/printed.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/sdk.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/sparklines.js +2 -0
- package/dist/node_modules/@allyhub/sheet/dist/table-style.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/table-styles.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/theme.js +2 -0
- package/dist/node_modules/@allyhub/sheet/dist/tiles.js +2 -0
- package/dist/node_modules/@allyhub/sheet/dist/units.js +2 -0
- package/dist/node_modules/@allyhub/sheet/dist/workbook.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/write.js +14 -14
- package/dist/node_modules/@allyhub/sheet/dist/xlsx/charts.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/xlsx/import.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/xlsx/read.js +2 -2
- package/dist/node_modules/@allyhub/sheet/dist/xlsx/styles.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/xlsx/theme.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/xlsx/write.js +1 -1
- package/dist/node_modules/@allyhub/sheet/package.json +1 -1
- package/dist/node_modules/@allyhub/sheet-extension/dist/build.js +1 -1
- package/dist/node_modules/@allyhub/sheet-extension/dist/cli/sheet.js +7 -7
- package/dist/node_modules/@allyhub/sheet-extension/dist/code.js +1 -1
- package/dist/node_modules/@allyhub/sheet-extension/dist/evaluate.js +2 -2
- package/dist/node_modules/@allyhub/sheet-extension/dist/export.js +2 -2
- package/dist/node_modules/@allyhub/sheet-extension/dist/inspect.js +2 -2
- package/dist/node_modules/@allyhub/sheet-extension/dist/migrations.js +4 -0
- package/dist/node_modules/@allyhub/sheet-extension/dist/project-tools.js +1 -1
- package/dist/node_modules/@allyhub/sheet-extension/dist/tools.js +1 -1
- package/dist/node_modules/@allyhub/sheet-extension/package.json +7 -3
- package/dist/node_modules/@allyhub/slides-core/dist/api.js +2 -2
- package/dist/node_modules/@allyhub/slides-core/dist/blocks.js +2 -0
- package/dist/node_modules/@allyhub/slides-core/dist/capabilities.js +1 -1
- package/dist/node_modules/@allyhub/slides-core/dist/chart-api.js +1 -1
- package/dist/node_modules/@allyhub/slides-core/dist/code.js +1 -1
- package/dist/node_modules/@allyhub/slides-core/dist/enums.js +1 -1
- package/dist/node_modules/@allyhub/slides-core/dist/file.js +3 -3
- package/dist/node_modules/@allyhub/slides-core/dist/index.js +1 -1
- package/dist/node_modules/@allyhub/slides-core/dist/measure.js +1 -1
- package/dist/node_modules/@allyhub/slides-core/dist/model.js +1 -1
- package/dist/node_modules/@allyhub/slides-core/dist/office-layouts.js +2 -0
- package/dist/node_modules/@allyhub/slides-core/dist/office.js +1 -1
- package/dist/node_modules/@allyhub/slides-core/dist/resolve.js +1 -1
- package/dist/node_modules/@allyhub/slides-core/dist/script.js +2 -2
- package/dist/node_modules/@allyhub/slides-core/dist/styles/brief.js +2 -0
- package/dist/node_modules/@allyhub/slides-core/dist/styles/editorial.js +2 -0
- package/dist/node_modules/@allyhub/slides-core/dist/styles/index.js +2 -0
- package/dist/node_modules/@allyhub/slides-core/dist/styles/kit.js +2 -0
- package/dist/node_modules/@allyhub/slides-core/dist/styles/layouts.js +2 -0
- package/dist/node_modules/@allyhub/slides-core/dist/styles/pitch.js +2 -0
- package/dist/node_modules/@allyhub/slides-core/dist/styles/stage.js +2 -0
- package/dist/node_modules/@allyhub/slides-core/dist/styles/tiles.js +2 -0
- package/dist/node_modules/@allyhub/slides-core/dist/theme.js +1 -1
- package/dist/node_modules/@allyhub/slides-core/dist/units.js +1 -1
- package/dist/node_modules/@allyhub/slides-core/package.json +1 -1
- package/dist/node_modules/@allyhub/slides-extension/dist/check.js +1 -1
- package/dist/node_modules/@allyhub/slides-extension/dist/cli/slides.js +2 -2
- package/dist/node_modules/@allyhub/slides-extension/dist/deck-fonts.js +1 -1
- package/dist/node_modules/@allyhub/slides-extension/dist/project-tools.js +1 -1
- package/dist/node_modules/@allyhub/slides-extension/package.json +24 -1
- package/dist/node_modules/@allyhub/slides-pptx/dist/charts.js +1 -1
- package/dist/node_modules/@allyhub/slides-pptx/dist/fonts.js +1 -1
- package/dist/node_modules/@allyhub/slides-pptx/dist/image-size.js +2 -0
- package/dist/node_modules/@allyhub/slides-pptx/dist/import/code.js +3 -3
- package/dist/node_modules/@allyhub/slides-pptx/dist/import/index.js +7 -2
- package/dist/node_modules/@allyhub/slides-pptx/dist/import/names.js +1 -1
- package/dist/node_modules/@allyhub/slides-pptx/dist/import/script.js +1 -1
- package/dist/node_modules/@allyhub/slides-pptx/dist/index.js +1 -1
- package/dist/node_modules/@allyhub/slides-pptx/dist/mtx.js +2 -0
- package/dist/node_modules/@allyhub/slides-pptx/dist/read/chart.js +3 -2
- package/dist/node_modules/@allyhub/slides-pptx/dist/read/chartex.js +3 -0
- package/dist/node_modules/@allyhub/slides-pptx/dist/read/common.js +1 -1
- package/dist/node_modules/@allyhub/slides-pptx/dist/read/index.js +2 -2
- package/dist/node_modules/@allyhub/slides-pptx/dist/read/shapes.js +1 -1
- package/dist/node_modules/@allyhub/slides-pptx/dist/read/table.js +1 -1
- package/dist/node_modules/@allyhub/slides-pptx/dist/read/text.js +1 -1
- package/dist/node_modules/@allyhub/slides-pptx/dist/read/timing.js +1 -1
- package/dist/node_modules/@allyhub/slides-pptx/dist/shapes.js +1 -1
- package/dist/node_modules/@allyhub/slides-pptx/dist/text.js +1 -1
- package/dist/node_modules/@allyhub/slides-pptx/dist/write.js +2 -2
- package/dist/node_modules/@allyhub/slides-pptx/dist/xml.js +3 -2
- package/dist/node_modules/@allyhub/slides-pptx/package.json +1 -1
- package/dist/node_modules/@allyhub/slides-runtime/dist/draw.js +2 -2
- package/dist/node_modules/@allyhub/slides-runtime/dist/load.js +1 -1
- package/dist/node_modules/@allyhub/slides-runtime/package.json +1 -1
- package/dist/node_modules/@allyhub/stage/package.json +1 -1
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/archivo/LICENSE +93 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/archivo/files/archivo-latin-400-italic.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/archivo/files/archivo-latin-400-normal.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/archivo/files/archivo-latin-700-italic.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/archivo/files/archivo-latin-700-normal.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/archivo/files/archivo-latin-ext-400-italic.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/archivo/files/archivo-latin-ext-400-normal.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/archivo/files/archivo-latin-ext-700-italic.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/archivo/files/archivo-latin-ext-700-normal.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/archivo/latin-400-italic.css +1 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/archivo/latin-400.css +1 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/archivo/latin-700-italic.css +1 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/archivo/latin-700.css +1 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/archivo/latin-ext-400-italic.css +1 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/archivo/latin-ext-400.css +1 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/archivo/latin-ext-700-italic.css +1 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/archivo/latin-ext-700.css +1 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/archivo-black/LICENSE +93 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/archivo-black/files/archivo-black-latin-400-normal.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/archivo-black/files/archivo-black-latin-ext-400-normal.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/archivo-black/latin-400.css +1 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/archivo-black/latin-ext-400.css +1 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/ibm-plex-sans/LICENSE +93 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/ibm-plex-sans/files/ibm-plex-sans-latin-400-italic.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/ibm-plex-sans/files/ibm-plex-sans-latin-400-normal.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/ibm-plex-sans/files/ibm-plex-sans-latin-700-italic.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/ibm-plex-sans/files/ibm-plex-sans-latin-700-normal.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/ibm-plex-sans/files/ibm-plex-sans-latin-ext-400-italic.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/ibm-plex-sans/files/ibm-plex-sans-latin-ext-400-normal.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/ibm-plex-sans/files/ibm-plex-sans-latin-ext-700-italic.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/ibm-plex-sans/files/ibm-plex-sans-latin-ext-700-normal.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/ibm-plex-sans/latin-400-italic.css +1 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/ibm-plex-sans/latin-400.css +1 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/ibm-plex-sans/latin-700-italic.css +1 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/ibm-plex-sans/latin-700.css +1 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/ibm-plex-sans/latin-ext-400-italic.css +1 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/ibm-plex-sans/latin-ext-400.css +1 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/ibm-plex-sans/latin-ext-700-italic.css +1 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/ibm-plex-sans/latin-ext-700.css +1 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/inter-static/LICENSE +93 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/inter-static/files/inter-latin-400-italic.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/inter-static/files/inter-latin-400-normal.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/inter-static/files/inter-latin-700-italic.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/inter-static/files/inter-latin-700-normal.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/inter-static/files/inter-latin-ext-400-italic.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/inter-static/files/inter-latin-ext-400-normal.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/inter-static/files/inter-latin-ext-700-italic.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/inter-static/files/inter-latin-ext-700-normal.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/inter-static/latin-400-italic.css +1 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/inter-static/latin-400.css +1 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/inter-static/latin-700-italic.css +1 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/inter-static/latin-700.css +1 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/inter-static/latin-ext-400-italic.css +1 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/inter-static/latin-ext-400.css +1 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/inter-static/latin-ext-700-italic.css +1 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/inter-static/latin-ext-700.css +1 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/newsreader/LICENSE +93 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/newsreader/files/newsreader-latin-400-italic.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/newsreader/files/newsreader-latin-400-normal.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/newsreader/files/newsreader-latin-700-italic.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/newsreader/files/newsreader-latin-700-normal.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/newsreader/files/newsreader-latin-ext-400-italic.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/newsreader/files/newsreader-latin-ext-400-normal.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/newsreader/files/newsreader-latin-ext-700-italic.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/newsreader/files/newsreader-latin-ext-700-normal.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/newsreader/latin-400-italic.css +1 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/newsreader/latin-400.css +1 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/newsreader/latin-700-italic.css +1 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/newsreader/latin-700.css +1 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/newsreader/latin-ext-400-italic.css +1 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/newsreader/latin-ext-400.css +1 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/newsreader/latin-ext-700-italic.css +1 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/newsreader/latin-ext-700.css +1 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/plus-jakarta-sans/LICENSE +93 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/plus-jakarta-sans/files/plus-jakarta-sans-latin-400-italic.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/plus-jakarta-sans/files/plus-jakarta-sans-latin-400-normal.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/plus-jakarta-sans/files/plus-jakarta-sans-latin-700-italic.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/plus-jakarta-sans/files/plus-jakarta-sans-latin-700-normal.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/plus-jakarta-sans/files/plus-jakarta-sans-latin-ext-400-italic.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/plus-jakarta-sans/files/plus-jakarta-sans-latin-ext-400-normal.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/plus-jakarta-sans/files/plus-jakarta-sans-latin-ext-700-italic.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/plus-jakarta-sans/files/plus-jakarta-sans-latin-ext-700-normal.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/plus-jakarta-sans/latin-400-italic.css +1 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/plus-jakarta-sans/latin-400.css +1 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/plus-jakarta-sans/latin-700-italic.css +1 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/plus-jakarta-sans/latin-700.css +1 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/plus-jakarta-sans/latin-ext-400-italic.css +1 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/plus-jakarta-sans/latin-ext-400.css +1 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/plus-jakarta-sans/latin-ext-700-italic.css +1 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/plus-jakarta-sans/latin-ext-700.css +1 -0
- package/dist/node_modules/@allyhub/stage-page/dist/host.js +1 -1
- package/dist/node_modules/@allyhub/stage-page/dist/runtime/stage.html +42 -0
- package/dist/node_modules/@allyhub/stage-page/dist/style-faces.js +2 -0
- package/dist/node_modules/@allyhub/stage-page/package.json +1 -1
- package/dist/node_modules/@allyhub/stage-runtime/dist/runtime.js +96 -92
- package/dist/node_modules/@allyhub/stage-runtime/package.json +1 -1
- package/dist/node_modules/@allyhub/telemetry/dist/limit.js +2 -0
- package/dist/node_modules/@allyhub/telemetry/package.json +5 -1
- package/dist/node_modules/@allyhub/text-extension/markup/allyhub.yaml +2 -0
- package/dist/node_modules/@allyhub/text-extension/markup-file/allyhub.yaml +2 -0
- package/dist/node_modules/@allyhub/text-extension/package.json +1 -1
- package/dist/node_modules/@allyhub/video-core/dist/footage-motion.js +1 -1
- package/dist/node_modules/@allyhub/video-core/dist/measure.js +1 -1
- package/dist/node_modules/@allyhub/video-core/dist/seams.js +1 -1
- package/dist/node_modules/@allyhub/video-core/package.json +1 -1
- package/dist/node_modules/@allyhub/video-extension/dist/cli/reference-text.js +1 -1
- package/dist/node_modules/@allyhub/video-extension/dist/inspect/index.js +1 -1
- package/dist/node_modules/@allyhub/video-extension/dist/inspect/joins.js +1 -1
- package/dist/node_modules/@allyhub/video-extension/dist/inspect/loop.js +3 -0
- package/dist/node_modules/@allyhub/video-extension/package.json +2 -25
- package/dist/node_modules/@allyhub/video-measure/dist/check.js +2 -2
- package/dist/node_modules/@allyhub/video-measure/dist/index.js +1 -1
- package/dist/node_modules/@allyhub/video-measure/dist/seams.js +1 -1
- package/dist/node_modules/@allyhub/video-measure/dist/version.js +1 -1
- package/dist/node_modules/@allyhub/video-measure/package.json +1 -1
- package/dist/node_modules/@allyhub/video-sdk/dist/free.js +1 -1
- package/dist/node_modules/@allyhub/video-sdk/package.json +1 -1
- package/dist/node_modules/@allyhub/website/dist/index.js +1 -1
- package/dist/node_modules/@allyhub/website/dist/website.js +2 -2
- package/dist/node_modules/@allyhub/website/package.json +1 -1
- package/dist/node_modules/@allyhub/website-extension/package.json +3 -3
- package/dist/node_modules/@allyhub/x-extension/package.json +1 -3
- package/dist/node_modules/@allyhub/x-extension/skills/allyhub/references/x.md +3 -3
- package/dist/node_modules/@allyhub/x-model/package.json +1 -1
- package/dist/node_modules/@allyhub/x-view/package.json +1 -1
- package/dist/package.json +14 -14
- package/dist/self-upgrade.js +2 -0
- package/dist/text/batch-text.js +1 -1
- package/dist/text/facts-text.js +5 -5
- package/dist/text/format.js +2 -2
- package/dist/update-notice.js +3 -0
- package/dist/version.js +1 -1
- package/dist/works.js +1 -1
- package/editor-web/assets/{abnfDiagram-WEYOIA3C-DYaMS_BB.js → abnfDiagram-WEYOIA3C-BkVJMd53.js} +1 -1
- package/editor-web/assets/{architecture-WOLXFQ4H-g_Tjfl_y.js → architecture-WOLXFQ4H-C6rnaynZ.js} +1 -1
- package/editor-web/assets/{architectureDiagram-ZHVYKT53-CqdhofOL.js → architectureDiagram-ZHVYKT53-D3vrh8LK.js} +1 -1
- package/editor-web/assets/arrow-down-D-QZrqcz.js +1 -0
- package/editor-web/assets/arrow-up-B1zjKUHX.js +1 -0
- package/editor-web/assets/article-DHf6mOY_.js +7 -0
- package/editor-web/assets/article-Dns1-Xh-.js +3 -0
- package/editor-web/assets/{audio-lines-PZj77e7t.js → audio-lines-BFoW_IeO.js} +1 -1
- package/editor-web/assets/bar-button-CKPfx2AB.js +1 -0
- package/editor-web/assets/{blockDiagram-RJAE7QA3-Bc-28Bci.js → blockDiagram-RJAE7QA3-BKngt8H7.js} +1 -1
- package/editor-web/assets/{browser-C9NP0ZYz.js → browser-DEGNhKTV.js} +1 -1
- package/editor-web/assets/{c4Diagram-XDPPPE54-CTGJb8FB.js → c4Diagram-XDPPPE54-j7sUELqF.js} +1 -1
- package/editor-web/assets/calc-worker-Cr4a0xmt.js +168 -0
- package/editor-web/assets/channel-CVWSV3su.js +1 -0
- package/editor-web/assets/{chart-no-axes-column-Be0lFcGF.js → chart-no-axes-column-Dyy25XZ_.js} +1 -1
- package/editor-web/assets/chip-Bn_9JRRG.js +1 -0
- package/editor-web/assets/{chunk-2E7WHVMD-B2MPOVTU.js → chunk-2E7WHVMD-BXa-uRSi.js} +1 -1
- package/editor-web/assets/{chunk-4EMNKR2T-BUV1ZHP0.js → chunk-4EMNKR2T-B3ntcsZN.js} +1 -1
- package/editor-web/assets/{chunk-55XCU76K-BZlpspL5.js → chunk-55XCU76K-AMvnFwUg.js} +1 -1
- package/editor-web/assets/{chunk-7S6XSTFO-CpKeisWE.js → chunk-7S6XSTFO-BA6esfFu.js} +1 -1
- package/editor-web/assets/{chunk-AQDTSKZB-BJqwAPyo.js → chunk-AQDTSKZB-BT_vANXs.js} +1 -1
- package/editor-web/assets/{chunk-DSNLSHJZ-D6oPWl_W.js → chunk-DSNLSHJZ-DoUgmzGB.js} +1 -1
- package/editor-web/assets/{chunk-HAGFOTED-B5pk4MZF.js → chunk-HAGFOTED-DtnIrCZb.js} +1 -1
- package/editor-web/assets/{chunk-HNE4Q36P-DHbSPvxQ.js → chunk-HNE4Q36P-BlPwQx3_.js} +1 -1
- package/editor-web/assets/{chunk-NQOKRVIF-CcL_GcRA.js → chunk-NQOKRVIF-D2r7jp2r.js} +1 -1
- package/editor-web/assets/{chunk-UHW7PFBP-YgiOL6XE.js → chunk-UHW7PFBP-Cmc0_F5o.js} +1 -1
- package/editor-web/assets/{chunk-VQ5W62QI-p14b4UYc.js → chunk-VQ5W62QI-nJSMqAr0.js} +1 -1
- package/editor-web/assets/{chunk-WQQL4CDK-BWW0x-XH.js → chunk-WQQL4CDK-Btq2nbF6.js} +1 -1
- package/editor-web/assets/{chunk-YZO67HFG-oG3qd68C.js → chunk-YZO67HFG-DTbcCoGt.js} +1 -1
- package/editor-web/assets/{chunk-ZAUX2LTX-CpcheH0u.js → chunk-ZAUX2LTX-DVwkg-2N.js} +1 -1
- package/editor-web/assets/{chunk-ZCHMQSOR-cWQvLl1w.js → chunk-ZCHMQSOR-BV39jOOE.js} +1 -1
- package/editor-web/assets/{classDiagram-v2-4MYWR3UA-7PG7YcdU.js → classDiagram-v2-4MYWR3UA-Cj74-fhM.js} +1 -1
- package/editor-web/assets/code-Ch6AB5bZ.js +1 -0
- package/editor-web/assets/collaborator-XiHOxwGM.js +1 -0
- package/editor-web/assets/{copy-CuJSs0nI.js → copy-SoaMYqsN.js} +1 -1
- package/editor-web/assets/{createLucideIcon-lm_6n8YT.js → createLucideIcon-euu7Wcd9.js} +1 -1
- package/editor-web/assets/{cynefin-EF2NZ3EQ-CtcknEQ_.js → cynefin-EF2NZ3EQ-C0CkiipV.js} +1 -1
- package/editor-web/assets/{cynefinDiagram-WF24UDRP-Ca7VIsjN.js → cynefinDiagram-WF24UDRP-hdsnJ4cI.js} +1 -1
- package/editor-web/assets/{dagre-NK4GIZVX-BzcSLtsr.js → dagre-NK4GIZVX-CC7WSgaK.js} +1 -1
- package/editor-web/assets/deck-DQpNIS2p.js +1 -0
- package/editor-web/assets/{diagram-CBK3MWTC-DpRmTGlG.js → diagram-CBK3MWTC-DmaVm13J.js} +1 -1
- package/editor-web/assets/{diagram-I5XIIV2D-BTrs_AX8.js → diagram-I5XIIV2D-De8jqp7b.js} +1 -1
- package/editor-web/assets/{diagram-ODIL2UCW-CkIVjPqH.js → diagram-ODIL2UCW-B5pBTulX.js} +1 -1
- package/editor-web/assets/{diagram-PFBEJUXE-BlFMbAG1.js → diagram-PFBEJUXE-BYsXg5_w.js} +1 -1
- package/editor-web/assets/{diagram-RJA3I4VV-D3f8VJ-D.js → diagram-RJA3I4VV-DZ8f6bYe.js} +1 -1
- package/editor-web/assets/{diagram-TYUNFSNR-Bbpngj6F.js → diagram-TYUNFSNR-qXHUsauD.js} +1 -1
- package/editor-web/assets/dist--z0ZHp4T.js +16 -0
- package/editor-web/assets/dist-9kuRjUTN.js +41 -0
- package/editor-web/assets/dist-B3rd02Cg.js +6 -0
- package/editor-web/assets/dist-B5GOGGEe.js +1 -0
- package/editor-web/assets/dist-Bx6q9kCu.js +1 -0
- package/editor-web/assets/dist-C4hHtrJr.js +1 -0
- package/editor-web/assets/dist-CCXJewsi.js +19 -0
- package/editor-web/assets/dist-CfK2BLl8.js +4 -0
- package/editor-web/assets/dist-Cmux3oJ_.js +1 -0
- package/editor-web/assets/dist-Cspf85KV.js +6 -0
- package/editor-web/assets/dist-DA72-4WB.js +82 -0
- package/editor-web/assets/{dist-DruvDNQe.js → dist-DAhe-kFC.js} +5 -5
- package/editor-web/assets/dist-DIJnhQFK.js +9 -0
- package/editor-web/assets/dist-DOrGo1GD.js +19 -0
- package/editor-web/assets/{dist-Bd8IxQPP.js → dist-DQ6RpEJD.js} +2 -2
- package/editor-web/assets/dist-DjiCHlSu.js +35 -0
- package/editor-web/assets/dist-Do4a40Wn.js +19 -0
- package/editor-web/assets/dist-FKEWS3Co.js +547 -0
- package/editor-web/assets/dist-QKd2i6kG.js +5 -0
- package/editor-web/assets/dist-SGnOfLhx.js +24 -0
- package/editor-web/assets/dist-VmVB7tl4.js +3 -0
- package/editor-web/assets/{docx-draw-CoK1oqQD.js → docx-draw-L54blreB.js} +1 -1
- package/editor-web/assets/{ebnfDiagram-V4P3TTPT-BaKj-yL6.js → ebnfDiagram-V4P3TTPT-B7-IfVI-.js} +1 -1
- package/editor-web/assets/{elk-QONTBCTQ-Cn2qv1_U.js → elk-QONTBCTQ-Gj_WaeBn.js} +1 -1
- package/editor-web/assets/{erDiagram-KYQIGQAA-Bd7AEIDo.js → erDiagram-KYQIGQAA-BDF6Qoqx.js} +1 -1
- package/editor-web/assets/esm-PQD5Pn8a.js +21 -0
- package/editor-web/assets/{eventmodeling-K75KTNOO-Sfp7_461.js → eventmodeling-K75KTNOO-elxVXXEe.js} +1 -1
- package/editor-web/assets/{file-question-mark-DlIjUK37.js → file-question-mark-PeZgyqkK.js} +1 -1
- package/editor-web/assets/flowDiagram-IUGLLWBU-B-25n8zE.js +1 -0
- package/editor-web/assets/{ganttDiagram-R7GPNTJY-CBqcGdHI.js → ganttDiagram-R7GPNTJY-CEogW3jW.js} +1 -1
- package/editor-web/assets/{gitGraph-VSP46ZUC-WTokXKTW.js → gitGraph-VSP46ZUC-Bh9cRWFa.js} +1 -1
- package/editor-web/assets/{gitGraphDiagram-PDYL7XHY-BIWZHD9q.js → gitGraphDiagram-PDYL7XHY-BQAvdM_V.js} +1 -1
- package/editor-web/assets/{group-BdrTp7gi.js → group-DwM2yqU8.js} +1 -1
- package/editor-web/assets/hint-CbwoSBMw.js +1 -0
- package/editor-web/assets/index-CXisi0Cj.css +2 -0
- package/editor-web/assets/index-wMlfx8aT.js +28 -0
- package/editor-web/assets/{info-OHQRW6UA-COC6G-_J.js → info-OHQRW6UA-CdPrqere.js} +1 -1
- package/editor-web/assets/{infoDiagram-MVDRKAX5-DpaqdKBD.js → infoDiagram-MVDRKAX5-uwIMeP44.js} +1 -1
- package/editor-web/assets/{ishikawaDiagram-HPEHV2GE-Dyn2MAy1.js → ishikawaDiagram-HPEHV2GE-rtfvqK7E.js} +1 -1
- package/editor-web/assets/iso-UwGLGD3F.js +1 -0
- package/editor-web/assets/{italic-zw4_eUNF.js → italic-BV7iHxoP.js} +1 -1
- package/editor-web/assets/{journeyDiagram-BOSHW7O7-DeSVfmm7.js → journeyDiagram-BOSHW7O7-mmhfIyVG.js} +1 -1
- package/editor-web/assets/{kanban-definition-FNSA4HC5-Bfg0lj7B.js → kanban-definition-FNSA4HC5-Fe7jBsi-.js} +1 -1
- package/editor-web/assets/{link-DopSU3aa.js → link-CFOv3nz-.js} +1 -1
- package/editor-web/assets/{mermaid-parser.core-CyhovuYE.js → mermaid-parser.core-BxOSjBH9.js} +3 -3
- package/editor-web/assets/{mermaid.core-Dx1fBVUG.js → mermaid.core-BOln9YdH.js} +4 -4
- package/editor-web/assets/{mindmap-definition-6OY57UG3-QEU2HF_m.js → mindmap-definition-6OY57UG3-M3Q1LOtO.js} +1 -1
- package/editor-web/assets/minus-ngE8owxs.js +1 -0
- package/editor-web/assets/{packet-JDAUHWVQ-ReJTa_hw.js → packet-JDAUHWVQ-Dbb0TUG6.js} +1 -1
- package/editor-web/assets/{pegDiagram-ECIUJNBX-Bo1jFrvb.js → pegDiagram-ECIUJNBX-BZMRpSFC.js} +1 -1
- package/editor-web/assets/{pie-XZMESJXO-BrtYafNA.js → pie-XZMESJXO-Ctm9XdKp.js} +1 -1
- package/editor-web/assets/{pieDiagram-GNMPY74T-Cj0zQqs_.js → pieDiagram-GNMPY74T-cGbs5ZTl.js} +1 -1
- package/editor-web/assets/progress-DZQTiRLv.js +6 -0
- package/editor-web/assets/{quadrantDiagram-D57K4MC3-D5npDAVn.js → quadrantDiagram-D57K4MC3-BUe_zsxT.js} +1 -1
- package/editor-web/assets/{radar-ABXABTNO-C8RDrRqi.js → radar-ABXABTNO-CCmKtqLs.js} +1 -1
- package/editor-web/assets/{railroad-I3PHUGI6-ebDrmYTK.js → railroad-I3PHUGI6-k-yhjhjA.js} +1 -1
- package/editor-web/assets/{railroad-abnf-LNEFI6M7-BxKuqg6V.js → railroad-abnf-LNEFI6M7-B-PvntB3.js} +1 -1
- package/editor-web/assets/{railroad-ebnf-DWYD2UWJ-DOclnfpr.js → railroad-ebnf-DWYD2UWJ-Ds2rua1h.js} +1 -1
- package/editor-web/assets/{railroad-peg-JR7BVNR7-DN0A1fpq.js → railroad-peg-JR7BVNR7-jNZ2wEp2.js} +1 -1
- package/editor-web/assets/{railroadDiagram-Y72NRBL7-B3PjoVWw.js → railroadDiagram-Y72NRBL7-CTqSQ15w.js} +1 -1
- package/editor-web/assets/react-Byupo4pA.js +1 -0
- package/editor-web/assets/replace-CLLMtF4e.js +1 -0
- package/editor-web/assets/{requirementDiagram-EQYSW5RA-DLdzkQk5.js → requirementDiagram-EQYSW5RA-CUblhR5M.js} +1 -1
- package/editor-web/assets/ribbon-DajdQ_Ya.js +1 -0
- package/editor-web/assets/row-Bei9HNEe.js +1 -0
- package/editor-web/assets/{sankeyDiagram-SY24JHO5-Dip4Piv_.js → sankeyDiagram-SY24JHO5-nSz6zDX3.js} +1 -1
- package/editor-web/assets/schemas-C21MyseF.js +1 -0
- package/editor-web/assets/{iso-DoC-ZoBr.js → schemas-DlRAoVtq.js} +1 -1
- package/editor-web/assets/{scissors-B_xOiUhd.js → scissors-m6QcoEf2.js} +1 -1
- package/editor-web/assets/search-D75Bi2GU.js +1 -0
- package/editor-web/assets/{sequenceDiagram-BLEHNHQU-QnPcoybL.js → sequenceDiagram-BLEHNHQU-DxTpOYuo.js} +1 -1
- package/editor-web/assets/{session-DMlLCFWg.js → session-BhClkDyr.js} +1 -1
- package/editor-web/assets/{sigma-DSUsJhMn.js → sigma-B4AWtnVA.js} +1 -1
- package/editor-web/assets/snapshots-DwGHDN3t.js +1 -0
- package/editor-web/assets/sound-DkR3qxSt.js +1 -0
- package/editor-web/assets/split-DBAbwPZ5.js +3 -0
- package/editor-web/assets/{square-arrow-out-up-right-DF5dvsSp.js → square-arrow-out-up-right-1NqFsNDe.js} +1 -1
- package/editor-web/assets/{stateDiagram-v2-A6IESKWZ-D103CiMX.js → stateDiagram-v2-A6IESKWZ-C3e14iHY.js} +1 -1
- package/editor-web/assets/{sticky-note-BdkIu5_D.js → sticky-note-s4QfzaBB.js} +1 -1
- package/editor-web/assets/surface-CIF0Ae0z.js +1 -0
- package/editor-web/assets/swatch-BUzr_XmH.js +1 -0
- package/editor-web/assets/{swimlanes-B3ENRKFQ-y4gCqEoa.js → swimlanes-B3ENRKFQ-DPPdzNzu.js} +1 -1
- package/editor-web/assets/swimlanesDiagram-AYQRV4AK-B8n3zOw_.js +8 -0
- package/editor-web/assets/switch-DrZxoPQS.js +1 -0
- package/editor-web/assets/{syntax-CU_WPKxt.js → syntax-emXV4DnN.js} +1 -1
- package/editor-web/assets/table-BW43XXVd.js +1 -0
- package/editor-web/assets/tabs-BwU2E7bU.js +1 -0
- package/editor-web/assets/text-wrap-Baus6l-V.js +1 -0
- package/editor-web/assets/textarea-BX_ax3X8.js +1 -0
- package/editor-web/assets/{timeline-definition-JXYKGLGB-BMp76v4V.js → timeline-definition-JXYKGLGB-DRTJ1_Er.js} +1 -1
- package/editor-web/assets/tolerant-DM9s0Mt1.js +1 -0
- package/editor-web/assets/{treeView-D4JQ5SDB-Q_GYyk0b.js → treeView-D4JQ5SDB-BYJ_m-i5.js} +1 -1
- package/editor-web/assets/{treemap-SAJKECNS-B5lRWdQB.js → treemap-SAJKECNS-BcU6I6Rg.js} +1 -1
- package/editor-web/assets/type-CvZ0HZsV.js +41 -0
- package/editor-web/assets/{undo-2-C47jrRp5.js → undo-2-DCbMWoug.js} +1 -1
- package/editor-web/assets/{usecaseDiagram-WPOLBNNX--QRllA-U.js → usecaseDiagram-WPOLBNNX-YV92pS4o.js} +1 -1
- package/editor-web/assets/{vennDiagram-Q3Y3IDCW-CzkATPA3.js → vennDiagram-Q3Y3IDCW-oAvfHZtf.js} +1 -1
- package/editor-web/assets/video-SJvDRCJK.js +1 -0
- package/editor-web/assets/{wardley-7MLQ67FV-BXzwcdJa.js → wardley-7MLQ67FV-BLNiqxtt.js} +1 -1
- package/editor-web/assets/{wardleyDiagram-IVAIDKWA-BQvC8Agx.js → wardleyDiagram-IVAIDKWA-SppgC6xW.js} +1 -1
- package/editor-web/assets/{whole-word-D3ZAtnkw.js → whole-word-C9TkGBCY.js} +1 -1
- package/editor-web/assets/{words-CaUHhQHf.js → words-BUlNNuH2.js} +3 -3
- package/editor-web/assets/words-zMedmPWc.js +3 -0
- package/editor-web/assets/workbook-BZKYx4WB.js +41 -0
- package/editor-web/assets/{xychartDiagram-4URNHDU4-aY-lsD5o.js → xychartDiagram-4URNHDU4-BHMn_jwJ.js} +1 -1
- package/editor-web/assets/{zoom-in-PgsC94hP.js → zoom-in-yAGKspfC.js} +1 -1
- package/editor-web/index.html +9 -8
- package/package.json +3 -3
- package/CHANGELOG.md +0 -251
- package/dist/commands/render.js +0 -3
- package/dist/node_modules/@allyhub/video-extension/dist/inspect/motion.js +0 -4
- package/dist/node_modules/@allyhub/video-measure/dist/still.js +0 -2
- package/editor-web/assets/arrow-down-B8VUPCGi.js +0 -1
- package/editor-web/assets/arrow-up-Ds4juY8X.js +0 -1
- package/editor-web/assets/article-8evPh712.js +0 -3
- package/editor-web/assets/article-BhRtWYMd.js +0 -7
- package/editor-web/assets/bar-button-J9vbfzTx.js +0 -1
- package/editor-web/assets/calc-worker-oEIqrrTM.js +0 -45
- package/editor-web/assets/channel-wIj_OqDm.js +0 -1
- package/editor-web/assets/chart-amT4lgX3.js +0 -2
- package/editor-web/assets/chart-file-dGiRgFcH.js +0 -1
- package/editor-web/assets/code-CD-CbJG9.js +0 -1
- package/editor-web/assets/collaborator-BU4qU7O3.js +0 -1
- package/editor-web/assets/deck-C7fN0Qtn.js +0 -1
- package/editor-web/assets/dist-3iovns9K.js +0 -16
- package/editor-web/assets/dist-BkHnbOEj.js +0 -4
- package/editor-web/assets/dist-BvOrNcK-.js +0 -19
- package/editor-web/assets/dist-CEIszq39.js +0 -1
- package/editor-web/assets/dist-CU5RbLNH.js +0 -1
- package/editor-web/assets/dist-CWZj8IAm.js +0 -1
- package/editor-web/assets/dist-C_Mtrnif.js +0 -17
- package/editor-web/assets/dist-CdqpwdCV.js +0 -24
- package/editor-web/assets/dist-CjT76RAw.js +0 -43
- package/editor-web/assets/dist-CpzEn9T8.js +0 -6
- package/editor-web/assets/dist-CrFYWl5-.js +0 -3
- package/editor-web/assets/dist-D3C6FyrO.js +0 -82
- package/editor-web/assets/dist-D4eBFGVL.js +0 -1
- package/editor-web/assets/dist-DTcjb3cP.js +0 -18
- package/editor-web/assets/dist-D_WSM29I.js +0 -17
- package/editor-web/assets/dist-Dp_9ISjP.js +0 -531
- package/editor-web/assets/dist-J-tPYKGS.js +0 -5
- package/editor-web/assets/dist-YW8hS4IM.js +0 -9
- package/editor-web/assets/esm-Cjv8ogpP.js +0 -21
- package/editor-web/assets/file-exclamation-point-_L3ElCJ5.js +0 -1
- package/editor-web/assets/flowDiagram-IUGLLWBU-BlVUglzw.js +0 -1
- package/editor-web/assets/hint-rlht0uxG.js +0 -1
- package/editor-web/assets/index-BQWZnyAQ.js +0 -28
- package/editor-web/assets/index-Dvh1t1om.css +0 -2
- package/editor-web/assets/minus-CbPnUIOy.js +0 -1
- package/editor-web/assets/progress-CwKcXARv.js +0 -6
- package/editor-web/assets/props-form-BpSXbrSF.js +0 -1
- package/editor-web/assets/react-Edyoga_4.js +0 -1
- package/editor-web/assets/row-C_svyL8o.js +0 -1
- package/editor-web/assets/schemas-CQ_UU8-Z.js +0 -1
- package/editor-web/assets/search-Ba2BbT6T.js +0 -1
- package/editor-web/assets/slides-7xWhREpt.js +0 -1
- package/editor-web/assets/snapshots-BLX4NTQC.js +0 -1
- package/editor-web/assets/sound-bTlco_K3.js +0 -1
- package/editor-web/assets/split-tFGKk-x8.js +0 -3
- package/editor-web/assets/strikethrough-BwXWi4zg.js +0 -1
- package/editor-web/assets/surface-DtCjIlrq.js +0 -1
- package/editor-web/assets/svg-CWIBMIQ9.js +0 -1
- package/editor-web/assets/swatch-DhztHwPU.js +0 -1
- package/editor-web/assets/swimlanesDiagram-AYQRV4AK-DKzB_wSf.js +0 -8
- package/editor-web/assets/switch-8MU4Nfxe.js +0 -1
- package/editor-web/assets/table-DRbddzx0.js +0 -1
- package/editor-web/assets/tabs-CuEawka3.js +0 -1
- package/editor-web/assets/tag-CIfWT8B_.js +0 -1
- package/editor-web/assets/text-align-start-Cic2-TLh.js +0 -1
- package/editor-web/assets/textarea-D7TnPwv1.js +0 -1
- package/editor-web/assets/video-D0uTbHWx.js +0 -1
- package/editor-web/assets/words-XlXG79Ur.js +0 -3
- package/editor-web/assets/workbook-CiCXkjmN.js +0 -45
- package/editor-web/assets/x-DlhyIKuu.js +0 -41
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@allyhub/build",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.20.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
7
7
|
"types": "./dist/index.d.ts",
|
|
8
8
|
"default": "./dist/index.js"
|
|
9
9
|
},
|
|
10
|
+
"./migrate": {
|
|
11
|
+
"types": "./dist/migrate.d.ts",
|
|
12
|
+
"default": "./dist/migrate.js"
|
|
13
|
+
},
|
|
10
14
|
"./project-root": {
|
|
11
15
|
"types": "./dist/project-root.d.ts",
|
|
12
16
|
"default": "./dist/project-root.js"
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
-
import{colorOfFile as
|
|
2
|
+
import{colorOfFile as te}from"@allyhub/formats";import{defaultLabels as ie,needsCategories as Y}from"./extended.js";import{isCombinable as oe,isScatter as se,labelPositionsOf as Z,pointLabelPosition as re}from"./chart.js";const O=e=>te(e)??"dk1";function ae(e,o){if(o.startsWith("/"))return o.slice(1);const n=e===""?[]:e.split("/");for(const y of o.split("/"))y===""||y==="."||(y===".."?n.pop():n.push(y));return n.join("/")}function J(e,o){if(e===void 0&&o===void 0)return;const n=e??{};return{...o===void 0?{}:{title:o},...n.min===void 0?{}:{minimum_scale:n.min},...n.max===void 0?{}:{maximum_scale:n.max},...n.major===void 0?{}:{major_unit:n.major},...n.gridlines===void 0?{}:{has_major_gridlines:n.gridlines},...n.visible===void 0?{}:{visible:n.visible},...n.format===void 0?{}:{number_format:n.format},...n.reverse===void 0?{}:{reverse_order:n.reverse},...n.gridline_color===void 0?{}:{gridline_color:O(n.gridline_color)},...n.line_color===void 0?{}:{line_color:O(n.line_color)},...n.labels===void 0?{}:{tick_label_position:n.labels},...n.tick_marks===void 0?{}:{major_tick_mark:n.tick_marks},...n.minor_tick_marks===void 0?{}:{minor_tick_mark:n.minor_tick_marks},...n.crosses===void 0?{}:{crosses:n.crosses},...n.crosses_at===void 0?{}:{crosses_at:n.crosses_at},...n.log_base===void 0?{}:{log_base:n.log_base},...n.units===void 0?{}:{display_units:n.units},...n.units_label===void 0?{}:{display_units_label:n.units_label},...n.minor===void 0?{}:{minor_unit:n.minor},...n.minor_gridlines===void 0?{}:{has_minor_gridlines:n.minor_gridlines},...n.label_angle===void 0?{}:{label_angle:n.label_angle},...n.label_every===void 0?{}:{label_interval:n.label_every}}}const W=(e,o)=>{if(e===void 0||e===!1)return;if(e===!0)return{show_value:!0};const n=o===void 0||e.first!==!0&&e.last!==!0?void 0:[...e.first===!0?[o.first]:[],...e.last===!0&&(e.first!==!0||o.last!==o.first)?[o.last]:[]];return{...e.bold===void 0?{}:{bold:e.bold},...n===void 0?{}:{points:n},...e.value===void 0?{}:{show_value:e.value},...e.percentage===void 0?{}:{show_percentage:e.percentage},...e.category===void 0?{}:{show_category_name:e.category},...e.series===void 0?{}:{show_series_name:e.series},...e.format===void 0?{}:{number_format:e.format},...e.position===void 0?{}:{position:e.position},...e.size===void 0?{}:{size:e.size},...e.color===void 0?{}:{color:O(e.color)}}};function B(e){if(typeof e=="number")return Number.isFinite(e)?e:void 0;if(e==null)return null;if(typeof e!="string")return;const o=e.trim();if(o==="")return null;const n=Number(o);return Number.isFinite(n)?n:void 0}export function chartOfFile(e,o){const n=t=>{const r=t.flatMap((i,l)=>i===null?[]:[l]);return{first:r[0]??0,last:r.at(-1)??t.length-1}},y=typeof e.labels=="object"&&(e.labels.first===!0||e.labels.last===!0),k=ie(e.type),z=y?void 0:e.labels===void 0&&k?k:W(e.labels),c=se(e.type);let m,A;const T=t=>{const r=Math.max(1,...t.map(i=>i.length));return A=t.map(i=>Array.from({length:r},(l,u)=>i[u]??"")),t.map(i=>[...i].reverse().find(l=>l!=="")??"")};let g;const P=t=>({...t.color===void 0?{}:{color:O(t.color)},...t.format===void 0?{}:{number_format:t.format},...t.smooth===void 0?{}:{smooth:t.smooth},...t.line_width===void 0?{}:{line_width:t.line_width},...t.marker_size===void 0?{}:{marker_size:t.marker_size},...t.type===void 0?{}:{type:t.type},...t.secondary===void 0?{}:{secondary:t.secondary},...t.line_dash===void 0?{}:{line_dash:t.line_dash},...t.marker===void 0?{}:{marker_symbol:t.marker},...t.transparency===void 0?{}:{transparency:t.transparency},...t.fill==="none"?{no_fill:!0}:{}});if(e.data!==void 0){let t;try{t=o.rows(e.data)}catch(s){o.problem(`${e.data} cannot be read: ${s instanceof Error?s.message:String(s)}`);return}if(!Array.isArray(t)||t.length===0){o.problem(`${e.data} holds no rows.`);return}const r=t,i=e.categories,l=Array.isArray(i)?i.flatMap(s=>typeof s=="string"?[s]:s):void 0,u=typeof i=="string"?i:l?.[0];if(u===void 0){o.problem("with data, categories names its column.");return}const d=Object.keys(r[0]??{}),w=[...l??[u],...e.series.map(s=>typeof s=="string"?s:s.name)].filter(s=>!d.includes(s));if(w.length>0){o.problem(`${e.data} has no column ${w.join(", ")} (it has ${d.join(", ")}).`);return}const x=s=>typeof s=="string"||typeof s=="number"?String(s):"";m=l&&l.length>1?T(r.map(s=>l.map(b=>x(s[b])))):r.map(s=>x(s[u])),g=e.series.map(s=>{const b=typeof s=="string"?s:s.name,N=r.map(($,I)=>{const E=B($[b]);return E===void 0?(o.problem(`${String(e.data)} row ${String(I+1)}: ${JSON.stringify($[b])} in ${b} is not a number.`),null):E});return{name:b,values:N,...c?{x:r.map($=>B($[u])??null)}:{},...typeof s!="string"&&s.size!==void 0?{sizes:r.map($=>B($[s.size??""])??null)}:{},...typeof s=="string"?{}:P(s)}})}else{if(typeof e.categories=="string"){o.problem("categories names a column, and there is no data to read.");return}if(e.categories===void 0&&Y(e.type)){o.problem(`a ${e.type} chart has categories.`);return}const t=e.categories??[];m=t.some(i=>Array.isArray(i))?T(t.map(i=>Array.isArray(i)?i:[i])):t.map(i=>Array.isArray(i)?i.join(" "):i);const r=[];for(const i of e.series){if(typeof i=="string"||!i.values){const l=typeof i=="string"?i:i.name;o.problem(`series ${l} has no values, and there is no data to read.`);return}if(c){if(i.x?.length!==i.values.length){o.problem(`series ${i.name} has an x for each of its values.`);return}}else i.values.length!==m.length&&!(!Y(e.type)&&m.length===0)&&o.problem(`series ${i.name} has ${String(i.values.length)} values for ${String(m.length)} categories.`);e.type==="bubble"&&i.sizes?.length!==i.values.length&&o.problem(`series ${i.name} has a size for each of its values.`),r.push({name:i.name,values:i.values,...c&&i.x?{x:i.x}:{},...i.sizes?{sizes:i.sizes}:{},...P(i)})}g=r}e.series.forEach((t,r)=>{const i=g[r];if(!i)return;const l=typeof t=="string"?void 0:t.points;if(l){const d=[];for(const[p,w]of Object.entries(l)){const x=m.indexOf(p);if(x<0){o.problem(`series ${i.name} has no category ${p} for points (it has ${m.join(", ")}).`);continue}d[x]=O(w.color)}d.length>0&&(i.point_colors=Array.from(d,p=>p))}const u=typeof t=="string"?void 0:t.labels;if(u===!1)i.labels=null;else if(u!==void 0){const d=W(u,n(i.values));d&&(i.labels=d)}else if(y){const d=W(e.labels,n(i.values));d&&(i.labels=d)}}),!oe(e.type)&&e.series.some(t=>typeof t!="string"&&(t.type!==void 0||t.secondary===!0))&&o.problem(`a ${e.type} chart combines with no other kind and has no second axis: only columns, lines and areas do.`);const F=z?.position;F!==void 0&&!Z(e.type).includes(F)&&o.problem(`a ${e.type} chart has no label position ${F}, which PowerPoint would repair (it has ${Z(e.type).join(", ")||"none"}).`);for(const[t,r]of[["value_axis",e.value_axis],["secondary_axis",e.secondary_axis]])r?.log_base!==void 0&&r.min!==void 0&&r.min<=0&&o.problem(`${t}'s logarithmic scale starts over 0, not at ${String(r.min)}: PowerPoint would repair it.`);const j=(e.totals??[]).flatMap(t=>{const r=m.indexOf(t);return r<0&&o.problem(`totals names ${t}, which is no category (it has ${m.join(", ")}).`),r<0?[]:[r]});e.type!=="waterfall"&&e.totals!==void 0&&o.problem(`only a waterfall has totals, not a ${e.type} chart.`);const q=J(e.value_axis,o.axisTitles?.value_axis),C=J(e.category_axis,o.axisTitles?.category_axis),M=J(e.secondary_axis,o.axisTitles?.secondary_axis);return o.pointText&&!c&&g.forEach((t,r)=>{const i=m.flatMap((l,u)=>{const d=o.pointText?.(l,t.name,r===0);return d===void 0?[]:[{index:u,text:d,...o.size===void 0?{position:re(t.values,u)}:le(g,r,u,d,o.size,e.value_axis,e.size)}]});i.length>0&&(g[r]={...t,point_labels:i})}),{type:e.type,categories:m,series:g,...o.title===void 0?{}:{title:o.title},...e.legend===void 0||e.legend==="none"?{}:{legend:e.legend},...z?{labels:z}:{},...e.gap_width===void 0?{}:{gap_width:e.gap_width},...e.overlap===void 0?{}:{overlap:e.overlap},...e.vary_by_categories===void 0?{}:{vary_by_categories:e.vary_by_categories},...e.category_colors===void 0?{}:{category_colors:e.category_colors.map(O)},...e.hole_size===void 0?{}:{hole_size:e.hole_size},...q?{value_axis:q}:{},...C?{category_axis:C}:{},...M?{secondary_axis:M}:{},...e.size===void 0?{}:{font_size:e.size},...e.title_size===void 0?{}:{title_size:e.title_size},...e.color===void 0?{}:{font_color:O(e.color)},...e.data===void 0?{}:{source:ae(o.base,e.data)},...j.length===0?{}:{totals:j},...e.connector_lines===void 0?{}:{connector_lines:e.connector_lines},...e.quartiles===void 0?{}:{quartile_method:e.quartiles},...e.mean_markers===void 0?{}:{show_mean_markers:e.mean_markers},...e.mean_line===void 0?{}:{show_mean_line:e.mean_line},...e.outliers===void 0?{}:{show_outliers:e.outliers},...e.inner_points===void 0?{}:{show_inner_points:e.inner_points},...e.bin_count===void 0?{}:{bin_count:e.bin_count},...e.bin_width===void 0?{}:{bin_width:e.bin_width},...e.overflow===void 0?{}:{overflow:e.overflow},...e.underflow===void 0?{}:{underflow:e.underflow},...e.interval_closed===void 0?{}:{interval_closed:e.interval_closed},...A===void 0?{}:{category_levels:A},...e.parent_labels===void 0?{}:{parent_labels:e.parent_labels},...e.high_low_lines===void 0?{}:{high_low_lines:e.high_low_lines},...e.secondary_gap_width===void 0?{}:{secondary_gap_width:e.secondary_gap_width},...e.orientation===void 0?{}:{orientation:e.orientation}}}function le(e,o,n,y,k,z,c=12){const m=e.flatMap(a=>a.values.filter(f=>f!==null)),A=e[o]?.values[n];if(m.length===0||A===null||A===void 0)return{position:"t"};const T=Math.min(...m),g=Math.max(...m),P=g-T||1,F=10**Math.floor(Math.log10(P/5)),j=([1,2,2.5,5,10].find(a=>a*F>=P/5)??10)*F,q=z?.min??Math.floor(T/j)*j,C=z?.max??Math.ceil((g+P*.05)/j)*j,M=c*3.5,t=c*2.5,r=k.width-M-c,i=k.height-t-c*2,l=e[o]?.values.length??1,u=a=>M+(a+.5)/l*r,d=a=>t+(1-(a-q)/(C-q||1))*i,p=u(n),w=d(A),x=y.split(`
|
|
3
|
+
`),s=Math.max(...x.map(a=>a.length))*c*.55,b=x.length*c*1.2,N=c*.9,$=n===l-1,I=n===0,E=(a,f,v)=>{const h=a==="r"?p+N:a==="l"?p-N-s:$?p-s:I?p:p-s/2,_=a==="t"?w-N-b:a==="b"?w+N:w-c*.6;return[h+f,_+v,h+f+s,_+v+b]},D=[];for(const a of e)for(let f=0;f+1<a.values.length;f++){const v=a.values[f],h=a.values[f+1];if(!(v===null||h===null||v===void 0||h===void 0))for(let _=0;_<=1;_+=.04)D.push([u(f+_),d(v+(h-v)*_)])}const L=c*.3;let G={position:"t"},H=1/0;for(const a of["t","b","r","l"])for(const f of[0,1,2,3])for(const v of[0,-1,1]){const h=(a==="b"?1:-1)*f*b*.5,_=v*s*.35,[K,Q,R,S]=E(a,_,h),ee=D.filter(([V,X])=>V>=K-L&&V<=R+L&&X>=Q-L&&X<=S+L).length,ne=(K<M?1:0)+(R>M+r?1:0)+(Q<t?1:0)+(S>t+i?1:0),U=ee*20+ne*100+(Math.abs(_)+Math.abs(h))/c;U<H&&(H=U,G=_===0&&h===0?{position:a}:{position:a,dx:Number((_/k.width).toFixed(4)),dy:Number((h/k.height).toFixed(4))})}return G}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
-
import{colorXml as
|
|
3
|
-
`,
|
|
4
|
-
`).map(
|
|
2
|
+
import{colorXml as be}from"./color.js";import{ACROSS_TICK as he,acrossBase as _e,actualThickness as ye,isAcross as ge,isRadar as oe,isRecipe as xe,isStock as se,JOIN_WIDTH as we,recipeDef as ve,recipeOrder as Pe,TARGET_WIDTH as ke}from"./classic.js";import{accentOf as F,CHART_AXIS as G,CHART_DEFAULTS as w,CHART_GRID as ce,CHART_INK as Ce,chartDrawing as W,groupingOf as H,groupsOf as ae,hasLines as Se,hasMarkers as Ae,isArea as K,isBar as N,isHorizontal as le,isLine as O,isRound as T,isScatter as Z,labelPositionOf as Le,variesOf as j,seeThrough as M}from"./chart.js";const $e="http://schemas.openxmlformats.org/drawingml/2006/chart",ze="http://schemas.openxmlformats.org/drawingml/2006/main",Re="http://schemas.openxmlformats.org/officeDocument/2006/relationships",Ie=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
3
|
+
`,D="2118791784",X="2140495176",$="2118791785",z="2140495177",Te={"&":"&","<":"<",">":">",'"':"""},Me=e=>{const t=e.charCodeAt(0);return t<32&&t!==9&&t!==10&&t!==13||t===65534||t===65535},y=e=>Array.from(e,t=>Me(t)?"":Te[t]??t).join("");function r(e,t={},...o){const c=Object.entries(t).filter(([,s])=>s!==void 0).map(([s,a])=>` ${s}="${y(typeof a=="boolean"?a?"1":"0":String(a))}"`).join(""),l=o.join("");return l===""?`<${e}${c}/>`:`<${e}${c}>${l}</${e}>`}const Be=e=>be(e),g=e=>e===null?r("a:noFill"):r("a:solidFill",{},Be(e)),n=(e,t)=>r(e,{val:typeof t=="boolean"?t?1:0:t}),h=(e,t,o)=>r("a:ln",t===void 0?{}:{w:Math.round(t*12700)},g(e),o===void 0||o==="solid"?"":n("a:prstDash",o)),Y=(e,t,o)=>r("c:txPr",{},r("a:bodyPr"),r("a:lstStyle"),r("a:p",{},r("a:pPr",{},r("a:defRPr",{...e===void 0?{}:{sz:Math.round(e*100)},...o===void 0?{}:{b:o?1:0}},t===void 0?"":g(t))),r("a:endParaRPr",{lang:"en-US"}))),q=e=>r("c:strCache",{},n("c:ptCount",e.length),...e.map((t,o)=>r("c:pt",{idx:o},`<c:v>${y(t)}</c:v>`))),S=(e,t)=>r("c:numCache",{},`<c:formatCode>${y(e??"General")}</c:formatCode>`,n("c:ptCount",t.length),...t.flatMap((o,c)=>o===null?[]:[r("c:pt",{idx:c},`<c:v>${String(o)}</c:v>`)])),ie=(e,t)=>r("c:tx",{},t===void 0?`<c:v>${y(e.name)}</c:v>`:r("c:strRef",{},`<c:f>${y(t)}</c:f>`,q([e.name]))),Fe=(e,t)=>t===void 0?"":r("c:xVal",{},r("c:numRef",{},`<c:f>${y(t)}</c:f>`,S("General",e.x??[])));function Ge(e,t,o,c){const l=t.color??F(o),s=M(l,t.transparency),a=T(e.type),i=Z(e.type),u=e.type==="bubble",b=oe(e.type),_=se(e.type),p=!u&&(O(e.type)||i||_||b&&e.type!=="radar-filled"),v=t.marker_symbol===void 0?Ae(e.type)||e.type==="stock-hlc"&&o===2:t.marker_symbol!=="none",m=t.marker_symbol??(_?"dash":"circle"),P=p?r("c:spPr",{},Se(e.type)&&!_&&t.line_width!==0?h(s,t.line_width??w.lineWidth,t.line_dash):r("a:ln",{w:19050},g(null))):t.no_fill===!0?r("c:spPr",{},g(null),h(s,1.5,t.line_dash)):r("c:spPr",{},g(s),a?h("lt1",1):""),k=c.categories;return r("c:ser",{},n("c:idx",o),n("c:order",o),ie(t,c.name(o)),P,N(e.type)?n("c:invertIfNegative",!1):"",p?r("c:marker",{},n("c:symbol",v?m:"none"),v?n("c:size",t.marker_size??w.marker):"",v?r("c:spPr",{},g(s),h(s)):""):"",...j(e)&&!p&&!K(e.type)?e.categories.map((C,d)=>r("c:dPt",{},n("c:idx",d),N(e.type)?n("c:invertIfNegative",!1):"",n("c:bubble3D",!1),r("c:spPr",{},g(M(t.point_colors?.[d]??e.category_colors?.[d]??F(d),t.transparency)),a?h("lt1",1):""))):[],...Ne(e,t,p,a,s),Oe(e,t,s),i?Fe(t,c.x?.(o)):k===void 0?"":r("c:cat",{},c.numeric===!0?r("c:numRef",{},`<c:f>${y(k)}</c:f>`,S(c.categoryFormat??"General",c.categoryNumbers??e.categories.map(C=>{const d=Number(C);return C===""||!Number.isFinite(d)?null:d}))):r("c:strRef",{},`<c:f>${y(k)}</c:f>`,q(e.categories))),r(i?"c:yVal":"c:val",{},r("c:numRef",{},`<c:f>${y(c.values(o))}</c:f>`,S(t.number_format,t.values))),u?r("c:bubbleSize",{},c.sizes?.(o)===void 0?r("c:numLit",{},"<c:formatCode>General</c:formatCode>",n("c:ptCount",t.values.length),...t.values.map((C,d)=>r("c:pt",{idx:d},`<c:v>${String(t.sizes?.[d]??1)}</c:v>`))):r("c:numRef",{},`<c:f>${y(c.sizes(o)??"")}</c:f>`,S("General",t.sizes??[])))+n("c:bubble3D",!1):"",p&&!b?n("c:smooth",t.smooth===!0||e.type==="scatter-smooth"):"")}function Ne(e,t,o,c,l){if(j(e)&&!o&&!K(e.type))return[];const s=new Set(o?(t.point_labels??[]).map(i=>i.index):[]),a=new Set((t.point_colors??[]).flatMap((i,u)=>i==null?[]:[u]));return[...new Set([...a,...s])].sort((i,u)=>i-u).map(i=>{const u=t.point_colors?.[i]??void 0,b=u===void 0?l:M(u,t.transparency),_=s.has(i);return r("c:dPt",{},n("c:idx",i),N(e.type)?n("c:invertIfNegative",!1):"",o?r("c:marker",{},n("c:symbol",t.marker_symbol??"circle"),n("c:size",_?7:t.marker_size??w.marker),r("c:spPr",{},g(b),_?h("lt1",1.5):h(b))):"",n("c:bubble3D",!1),!o&&a.has(i)?r("c:spPr",{},t.no_fill===!0?g(null)+h(b,1.5):g(b),c?h("lt1",1):""):"")})}function J(e,t,o=!0){const c=t.show_percentage===!0,l=Le({type:e.type,labels:t});return o?[t.number_format===void 0?"":r("c:numFmt",{formatCode:t.number_format,sourceLinked:0}),t.size===void 0&&t.color===void 0&&t.bold===void 0&&!T(e.type)?"":Y(t.size,t.color??(T(e.type)?"lt1":void 0),t.bold),l===void 0?"":n("c:dLblPos",l),n("c:showLegendKey",!1),n("c:showVal",t.show_value??!c),n("c:showCatName",t.show_category_name===!0),n("c:showSerName",t.show_series_name===!0),n("c:showPercent",c),n("c:showBubbleSize",!1)]:[n("c:showLegendKey",!1),n("c:showVal",!1),n("c:showCatName",!1),n("c:showSerName",!1),n("c:showPercent",!1),n("c:showBubbleSize",!1)]}const de={show_value:!1,show_percentage:!1};function Oe(e,t,o){const c=t.point_labels??[],l=t.labels;if(c.length===0&&l===void 0&&e.labels?.points===void 0)return"";const a=(l===void 0?e.labels:l)??void 0,i=a?.points,u=a&&i===void 0?a:void 0,b=new Set(c.map(m=>m.index)),_=[...c.map(m=>({index:m.index,word:m})),...a&&i?i.filter(m=>!b.has(m)).map(m=>({index:m})):[]].sort((m,P)=>m.index-P.index),p=a?.size??e.labels?.size,v=a?.color??e.labels?.color;return r("c:dLbls",{},..._.map(m=>m.word?r("c:dLbl",{},n("c:idx",m.index),m.word.dx===void 0&&m.word.dy===void 0?"":r("c:layout",{},r("c:manualLayout",{},n("c:x",m.word.dx??0),n("c:y",m.word.dy??0))),r("c:tx",{},r("c:rich",{},r("a:bodyPr"),r("a:lstStyle"),...m.word.text.split(`
|
|
4
|
+
`).map((P,k)=>r("a:p",{},r("a:r",{},k===0?r("a:rPr",{lang:"en-US",b:1},g(o)):"",`<a:t>${y(P)}</a:t>`))))),p===void 0&&v===void 0?"":Y(p,v),n("c:dLblPos",m.word.position),n("c:showLegendKey",!1),n("c:showVal",!0),n("c:showCatName",!1),n("c:showSerName",!1),n("c:showPercent",!1),n("c:showBubbleSize",!1)):r("c:dLbl",{},n("c:idx",m.index),...J(e,a??de))),...J(e,u??de,u!==void 0))}function A(e){const t=e.labels;return t?r("c:dLbls",{},...J(e,t,t.points===void 0)):""}function je(e,t){const o=ae(e);return o.length<=1?E(e,e.series.map((c,l)=>l),t,!1):o.map(c=>E({...e,type:c.kind,...c.secondary&&e.secondary_gap_width!==void 0?{gap_width:e.secondary_gap_width}:{}},c.series,t,c.secondary)).join("")}function E(e,t,o,c){const l=t.map(i=>{const u=e.series[i];return u?Ge(e,u,i,o):""}).join(""),s=H(e.type),a=c?n("c:axId",$)+n("c:axId",z):n("c:axId",D)+n("c:axId",X);if(T(e.type)){const i=e.type==="pie";return r(i?"c:pieChart":"c:doughnutChart",{},n("c:varyColors",j(e)),l,A(e),n("c:firstSliceAng",0),i?"":n("c:holeSize",e.hole_size??50))}if(oe(e.type))return r("c:radarChart",{},n("c:radarStyle",e.type==="radar-filled"?"filled":"marker"),n("c:varyColors",!1),l,A(e),a);if(e.type==="bubble")return r("c:bubbleChart",{},n("c:varyColors",!1),l,A(e),n("c:bubbleScale",100),n("c:showNegBubbles",!1),a);if(se(e.type))return r("c:stockChart",{},l,A(e),r("c:hiLowLines",{},r("c:spPr",{},h(G,w.gridWidth*1.5))),e.type==="stock-ohlc"?r("c:upDownBars",{},n("c:gapWidth",150),r("c:upBars",{},r("c:spPr",{},g("bg1"),h("tx1",.75))),r("c:downBars",{},r("c:spPr",{},g("tx1"),h("tx1",.75)))):"",a);if(Z(e.type))return r("c:scatterChart",{},n("c:scatterStyle","lineMarker"),n("c:varyColors",!1),l,A(e),a);if(N(e.type)){const i=s!=="clustered";return r("c:barChart",{},n("c:barDir",le(e.type)?"bar":"col"),n("c:grouping",s),n("c:varyColors",j(e)),l,A(e),n("c:gapWidth",e.gap_width??150),e.overlap!==void 0||i?n("c:overlap",e.overlap??100):"",a)}return r(O(e.type)?"c:lineChart":"c:areaChart",{},n("c:grouping",s),n("c:varyColors",!1),l,A(e),O(e.type)&&e.high_low_lines===!0?r("c:hiLowLines",{},r("c:spPr",{},h(G,w.lineWidth))):"",O(e.type)?n("c:marker",!0):"",a)}const R=e=>r("c:scaling",{},e.log_base===void 0?"":n("c:logBase",e.log_base),n("c:orientation",e.reverse_order===!0?"maxMin":"minMax"),e.maximum_scale===void 0?"":n("c:max",e.maximum_scale),e.minimum_scale===void 0?"":n("c:min",e.minimum_scale)),Q=e=>r("c:spPr",{},h(e.line_color??G,w.gridWidth)),V=e=>(e.has_major_gridlines===!0?r("c:majorGridlines",{},r("c:spPr",{},h(e.gridline_color??ce,w.gridWidth))):"")+(e.has_minor_gridlines===!0?r("c:minorGridlines",{},r("c:spPr",{},h(e.gridline_color??ce,w.gridWidth/2))):""),ee=e=>e.crosses_at!==void 0?n("c:crossesAt",e.crosses_at):n("c:crosses",e.crosses??"autoZero"),ne=e=>(e.minor_unit===void 0?"":n("c:minorUnit",e.minor_unit))+(e.display_units===void 0?"":r("c:dispUnits",{},n("c:builtInUnit",e.display_units),e.display_units_label===!1?"":r("c:dispUnitsLbl"))),ue=(e,t)=>r("c:rich",{},r("a:bodyPr"),r("a:lstStyle"),...e.split(`
|
|
5
|
+
`).map(o=>r("a:p",{},r("a:pPr",{},r("a:defRPr",{sz:t,b:0})),r("a:r",{},r("a:rPr",{lang:"en-US",sz:t,b:0}),`<a:t>${y(o)}</a:t>`)))),U=(e,t)=>e===void 0||e===""?"":r("c:title",{},r("c:tx",{},ue(e,t)),n("c:overlay",!1)),te=(e,t)=>e.major_unit!==void 0?n("c:majorUnit",e.major_unit):(e.minimum_scale!==void 0||e.maximum_scale!==void 0)&&t?n("c:majorUnit",t.major):"",I=(e,t,o,c="none")=>t?[n("c:majorTickMark","none"),n("c:minorTickMark","none"),n("c:tickLblPos","none"),r("c:spPr",{},h(null))]:[n("c:majorTickMark",e.major_tick_mark??c),n("c:minorTickMark",e.minor_tick_mark??"none"),n("c:tickLblPos",e.tick_label_position??"nextTo"),o,e.label_angle===void 0||e.label_angle===0?"":r("c:txPr",{},r("a:bodyPr",{rot:Math.round(e.label_angle*6e4),vert:"horz"}),r("a:lstStyle"),r("a:p",{},r("a:pPr",{},r("a:defRPr")),r("a:endParaRPr",{lang:"en-US"})))];function De(e,t,o){if(T(e.type))return"";const c=Z(e.type),l=le(e.type),s=e.category_axis??{},a={has_major_gridlines:!0,...e.value_axis},i=H(e.type)==="percentStacked",u=a.number_format??(i?"0%":e.series[0]?.number_format??"General"),b=Math.round((e.font_size??w.fontSize)*100);return(c?r("c:valAx",{},n("c:axId",D),R(s),n("c:delete",s.visible===!1),n("c:axPos","b"),V(s),U(s.title,b),r("c:numFmt",{formatCode:s.number_format??"General",sourceLinked:s.number_format===void 0?1:0}),...I(s,s.visible===!1,Q(s)),n("c:crossAx",X),ee(a),n("c:crossBetween","midCat"),te(s,void 0),ne(s)):r("c:catAx",{},n("c:axId",D),R(s),n("c:delete",s.visible===!1),n("c:axPos",l?"l":"b"),V(s),U(s.title,b),t?.numeric===!0?r("c:numFmt",{formatCode:s.number_format??t.categoryFormat??"General",sourceLinked:s.number_format===void 0?1:0}):r("c:numFmt",{formatCode:"General",sourceLinked:0}),...I(s,s.visible===!1,Q(s)),n("c:crossAx",X),ee(a),n("c:auto",!0),n("c:lblAlgn","ctr"),n("c:lblOffset",100),s.label_interval===void 0?"":n("c:tickLblSkip",s.label_interval),n("c:noMultiLvlLbl",!1)))+r("c:valAx",{},n("c:axId",X),R(a),n("c:delete",a.visible===!1),n("c:axPos",l?"b":"l"),V(a),U(a.title,b),r("c:numFmt",{formatCode:u,sourceLinked:a.number_format===void 0&&!i?1:0}),...I(a,a.visible===!1,a.line_color===void 0?r("c:spPr",{},h(null)):Q(a)),n("c:crossAx",D),ee(s),n("c:crossBetween",K(e.type)||c?"midCat":"between"),te(a,c?void 0:o?.value),ne(a))+Xe(e,b,o?.secondary)}function Xe(e,t,o){const c=ae(e).find(i=>i.secondary);if(!c)return"";const l=e.secondary_axis??{},s=H(c.kind)==="percentStacked",a=l.number_format??(s?"0%":e.series[c.series[0]??0]?.number_format??"General");return r("c:catAx",{},n("c:axId",$),R({}),n("c:delete",!0),n("c:axPos","b"),r("c:numFmt",{formatCode:"General",sourceLinked:1}),...I({},!0,""),n("c:crossAx",z),n("c:crosses","autoZero"),n("c:auto",!0),n("c:lblAlgn","ctr"),n("c:lblOffset",100),n("c:noMultiLvlLbl",!1))+r("c:valAx",{},n("c:axId",z),R(l),n("c:delete",l.visible===!1),n("c:axPos","r"),V(l),U(l.title,t),r("c:numFmt",{formatCode:a,sourceLinked:l.number_format===void 0&&!s?1:0}),...I(l,l.visible===!1,r("c:spPr",{},h(null))),n("c:crossAx",$),n("c:crosses","max"),n("c:crossBetween","between"),te(l,o),ne(l))}const Ee={bottom:"b",top:"t",left:"l",right:"r"};function Ve(e,t){const o=t.width,c=t.height,{plot:l}=W(e,o,c),s=a=>Number(a.toFixed(5));return r("c:layout",{},r("c:manualLayout",{},n("c:layoutTarget","inner"),n("c:xMode","edge"),n("c:yMode","edge"),n("c:x",s(l.x/o)),n("c:y",s(l.y/c)),n("c:w",s(l.width/o)),n("c:h",s(l.height/c))))}const me=e=>r("c:numLit",{},"<c:formatCode>General</c:formatCode>",n("c:ptCount",e.length),...e.flatMap((t,o)=>t===null?[]:[r("c:pt",{idx:o},`<c:v>${String(t)}</c:v>`)])),Ue=/^(.*!)?\$?([A-Z]{1,3})\$?(\d+)(?::\$?([A-Z]{1,3})\$?(\d+))?$/;function We(e,t){const o=Ue.exec(e);if(!o)return;const[,c="",l="",s="",a,i]=o,u=Number(s)+t;if(!(a!==void 0&&a!==l||u>Number(i??s)))return`${c}$${l}$${String(u)}`}function He(e,t,o,c){const l=e.categories.length,s=e.categories.map((d,f)=>f+.5),a=(d,f,...x)=>r("c:ser",{},n("c:idx",d),n("c:order",d),f?ie(f,o.name(d)):"",...x,n("c:smooth",!1)),i=(d,f)=>r("c:xVal",{},r("c:numRef",{},`<c:f>${y(o.values(d))}</c:f>`,S(f.number_format,f.values))),u=d=>r("c:yVal",{},me(d)),b=r("c:spPr",{},r("a:ln",{w:19050},g(null))),_=r("c:marker",{},n("c:symbol","none")),p=(d,f)=>r("a:ln",{w:Math.round(f*12700),cap:"flat"},g(d)),v=(...d)=>r("c:scatterChart",{},n("c:scatterStyle","lineMarker"),n("c:varyColors",!1),...d,n("c:axId",$),n("c:axId",z));if(e.type==="bullet"){const d=Math.max(0,e.series.length-2),[f,x]=e.series,B=W(t,c?.width??360,c?.height??216),L=ye(t,B.plot.height);return E(t,Array.from({length:d},(re,pe)=>pe),o,!1)+v(f?a(d,f,b,_,r("c:errBars",{},n("c:errDir","x"),n("c:errBarType","minus"),n("c:errValType","cust"),n("c:noEndCap",!0),r("c:minus",{},r("c:numRef",{},`<c:f>${y(o.values(d))}</c:f>`,S(f.number_format,f.values))),r("c:spPr",{},p(M(f.color??F(0),f.transparency),L))),i(d,f),u(s)):"",x?a(d+1,x,b,_,r("c:errBars",{},n("c:errDir","y"),n("c:errBarType","both"),n("c:errValType","fixedVal"),n("c:noEndCap",!0),n("c:val",he),r("c:spPr",{},p(x.color??"tx1",ke))),i(d+1,x),u(s)):"")}const[m]=e.series,P=e.categories.map((d,f)=>{const x=e.series.map((L,re)=>We(o.values(re),f)),B=e.series.map(L=>L.values[f]??null);return a(1+f,void 0,r("c:spPr",{},p(G,we)),_,r("c:xVal",{},x.every(L=>L!==void 0)?r("c:numRef",{},`<c:f>${y(`(${x.join(",")})`)}</c:f>`,S(m?.number_format,B)):me(B)),u(e.series.map(()=>f+.5)))}),k=e.series.map((d,f)=>{const x=M(d.color??F(f),d.transparency);return a(1+l+f,d,b,r("c:marker",{},n("c:symbol",d.marker_symbol??"circle"),n("c:size",d.marker_size??9),r("c:spPr",{},g(x),h(x))),i(f,d),u(s))}),C={...t};return delete C.labels,(m?E({...C,series:[{...Ke(m),transparency:1}]},[0],o,!1):"")+v(...P,...k)}const Ke=e=>{const t={...e};return delete t.point_labels,t};function Ze(e){const t=(c,l,s,a)=>r("c:valAx",{},n("c:axId",c),R(a),n("c:delete",!0),n("c:axPos",s),r("c:numFmt",{formatCode:"General",sourceLinked:1}),...I({},!0,""),n("c:crossAx",l),n("c:crosses","autoZero"),n("c:crossBetween","midCat")),o=e.value_axis??{};return t($,z,"t",{...o.minimum_scale===void 0?{}:{minimum_scale:o.minimum_scale},...o.maximum_scale===void 0?{}:{maximum_scale:o.maximum_scale}})+t(z,$,"r",{minimum_scale:0,maximum_scale:Math.max(1,e.categories.length),reverse_order:!0})}const fe=r("c:spPr",{},r("a:noFill"),r("a:ln",{},r("a:noFill")));export function chartSpaceXml(e,t){if(xe(e.type)){const a=Pe(e),i=p=>a[p]??p,{x:u,sizes:b}=t.refs,_=ge(e);return chartSpaceXml(_?_e(e):ve(e,t.frame?.height??216),{...t,..._?{across:e}:{},refs:{...t.refs,name:p=>t.refs.name(i(p)),values:p=>t.refs.values(i(p)),...u?{x:p=>u(i(p))}:{},...b?{sizes:p=>b(i(p))}:{}}})}const o=e,c=o.title!==void 0&&o.title!==""?o.title:void 0,l=o.font_size??w.fontSize,s=Math.round((o.title_size??l*w.titleScale)*100);return Ie+r("c:chartSpace",{"xmlns:c":$e,"xmlns:a":ze,"xmlns:r":Re},n("c:date1904",!1),n("c:roundedCorners",!1),r("c:chart",{},c===void 0?"":r("c:title",{},r("c:tx",{},t.titleRef===void 0?ue(c,s):r("c:strRef",{},`<c:f>${y(t.titleRef)}</c:f>`,q([c]))),n("c:overlay",!1)),n("c:autoTitleDeleted",c===void 0),r("c:plotArea",{},t.frame?Ve(o,t.frame):r("c:layout"),t.across?He(t.across,o,t.refs,t.frame):je(o,t.refs),De(o,t.refs,W(o,t.frame?.width??360,t.frame?.height??216).scales),t.across?Ze(o):"",t.frameless===!0?fe:""),o.legend===void 0?"":r("c:legend",{},n("c:legendPos",Ee[o.legend]),...t.across?.type==="dumbbell"?Array.from({length:1+o.categories.length},(a,i)=>r("c:legendEntry",{},n("c:idx",i),n("c:delete",!0))):[],n("c:overlay",o.legend_overlay===!0)),n("c:plotVisOnly",t.plotVisible??!0),n("c:dispBlanksAs","gap")),t.frameless===!0?fe:"",Y(l,o.font_color??Ce),t.tail??"")}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
-
import{format as Zt,isValidFormat as Ut}from"numfmt";export const CHART_DEFAULTS={fontSize:12,titleScale:1.2,gapWidth:150,holeSize:50,margin:6,gridline:"#D9D9D9",axisLine:"#BFBFBF",letter:.55,lineWidth:2.25,gridWidth:.75,marker:5};const jt=["accent1","accent2","accent3","accent4","accent5","accent6"];export const accentOf=t=>jt[t%jt.length]??"accent1",isBar=t=>t.startsWith("column")||t.startsWith("bar"),isHorizontal=t=>t.startsWith("bar"),isLine=t=>t.startsWith("line"),isArea=t=>t.startsWith("area"),isRound=t=>t==="pie"||t==="doughnut",isScatter=t=>t.startsWith("scatter"),hasLines=t=>!isScatter(t)||t!=="scatter",hasMarkers=t=>t==="line-markers"||t==="scatter"||t==="scatter-lines",groupingOf=t=>t.endsWith("-100")?"percentStacked":t.endsWith("-stacked")?"stacked":isBar(t)?"clustered":"standard";export function labelPositionsOf(t){return isArea(t)||t==="doughnut"?[]:t==="pie"?["bestFit","outEnd","inEnd","ctr"]:isLine(t)||isScatter(t)?["t","b","l","r","ctr"]:groupingOf(t)==="clustered"?["outEnd","inEnd","ctr","inBase"]:["inEnd","ctr","inBase"]}export function labelPositionOf(t){const c=labelPositionsOf(t.type),h=t.labels?.position;if(h!==void 0&&c.includes(h))return h;if(c.length!==0)return t.type==="pie"?"ctr":isLine(t.type)||isScatter(t.type)?"t":groupingOf(t.type)==="clustered"?"outEnd":"ctr"}export const isCombinable=t=>t.startsWith("column")||isLine(t)||isArea(t);export function groupsOf(t){const c=isCombinable(t.type),h=[];if(t.series.forEach((n,i)=>{const o=n.type!==void 0&&c&&isCombinable(n.type)?n.type??t.type:t.type,S=c&&n.secondary===!0,_=h.find(A=>A.kind===o&&A.secondary===S);_?_.series.push(i):h.push({kind:o,secondary:S,series:[i]})}),h.every(n=>n.secondary))for(const n of h)n.secondary=!1;const r=n=>(n.secondary?3:0)+(isArea(n.kind)?0:isBar(n.kind)?1:2);return h.sort((n,i)=>r(n)-r(i))}export const variesOf=t=>t.vary_by_categories??isRound(t.type);export function formatValue(t,c="General"){return c==="General"||!Ut(c)?String(Number(t.toPrecision(10))):Zt(c,t)}const qt=[1,2,5,10];export function chartScale(t,c,h,r,n={}){const i=t>0&&(c-t)/c<.16666666666666666?t:Math.min(t,0),a=c<=0&&t<0?0:c,o=n.minimum_scale??i,S=n.maximum_scale??a,_=S>o?S-o:1,A=Math.max(1,Math.floor(h/r)),k=_/A,O=10**Math.floor(Math.log10(k)),T=n.major_unit??(qt.find(E=>E*O>=k)??10)*O,D=(E,P)=>Number((P(Number((E/T).toFixed(9)))*T).toPrecision(12)),U=a>0?a+_*.05:a===i?_:a,x=n.maximum_scale??D(U,Math.ceil),tt=i<0?i-_*.05:i,N=n.minimum_scale??D(tt,Math.floor),B=[],M=Math.round((x-N)/T);for(let E=0;E<=M;E++)B.push(Number((N+E*T).toPrecision(12)));return{min:N,max:x,major:T,ticks:B}}const Jt=[278,278,355,556,556,889,667,191,333,333,389,584,278,333,278,278,556,556,556,556,556,556,556,556,556,556,278,278,584,584,584,556,1015,667,667,722,722,667,611,778,722,278,500,667,556,833,722,778,667,778,722,667,611,722,667,944,667,667,611,278,278,278,469,556,333,556,556,500,556,556,278,556,556,222,222,500,222,833,556,556,556,556,333,500,278,556,500,722,500,500,500,334,260,334,584],it=(t,c)=>{let h=0;for(const r of t){const n=r.codePointAt(0)??0,i=Jt[n-32];h+=i!==void 0?i/1e3:n>11903?1:CHART_DEFAULTS.letter}return h*c},m=t=>String(Number(t.toFixed(3)));function Nt(t){const c=h=>t[Math.max(0,Math.min(t.length-1,h))]??[0,0];return t.map(([h,r],n)=>{if(n===0)return`M${m(h)} ${m(r)}`;const[i,a]=c(n-2),[o,S]=c(n-1),[_,A]=c(n+1),k=`${m(o+(h-i)/6)} ${m(S+(r-a)/6)}`,O=`${m(h-(_-o)/6)} ${m(r-(A-S)/6)}`;return`C${k} ${O} ${m(h)} ${m(r)}`}).join(" ")}const xt=t=>t.map(([c,h],r)=>`${r===0?"M":"L"}${m(c)} ${m(h)}`).join(" ");function Kt(t,c,h,r,n,i){const a=(A,k)=>`${m(t+A*Math.sin(k))} ${m(c-A*Math.cos(k))}`,o=i-n>=Math.PI*2?n+Math.PI*2-1e-4:i,S=o-n>Math.PI?1:0,_=`M${a(h,n)} A${m(h)} ${m(h)} 0 ${String(S)} 1 ${a(h,o)}`;return r<=0?`${_} L${m(t)} ${m(c)} Z`:`${_} L${a(r,o)} A${m(r)} ${m(r)} 0 ${String(S)} 0 ${a(r,n)} Z`}function Tt(t,c,h,r){const n=r*1.5;return c!==void 0&&c!==""&&(t.bottom-=n),h!==void 0&&h!==""&&(t.left+=n),{x:t.left-n/2,y:t.bottom+n/2}}function Bt(t,c,h,r,n,i,a){r!==void 0&&r!==""&&t.words.push({x:c.x+c.width/2,y:h.y,text:r,size:i,anchor:"middle",color:a}),n!==void 0&&n!==""&&t.words.push({x:h.x,y:c.y+c.height/2,text:n,size:i,anchor:"middle",color:a,rotate:-90})}const yt=(t,c,h,r,n)=>{const i=t.labels;if(!i)return"";const a=isRound(t.type),o=[];return i.show_series_name&&o.push(r.name),i.show_category_name&&o.push(n),(i.show_value??!(i.show_percentage??!1))&&o.push(formatValue(c,i.number_format??r.number_format)),i.show_percentage&&a&&o.push(formatValue(h,i.number_format??"0%")),o.join(", ")};function Qt(t,c,h,r,n){const i=CHART_DEFAULTS,a=t.category_axis??{},o=t.value_axis??{},S=Tt(h,a.title,o.title,r),_=t.series.map(p=>p.values.flatMap((v,R)=>{const z=p.x?.[R]??(p.x?null:R+1);return z===null||v===null?[]:[[z,v]]})),A=_.flat().map(p=>p[0]),k=_.flat().map(p=>p[1]),O=p=>p.length>0?Math.min(...p):0,T=p=>p.length>0?Math.max(...p):1,D=o.number_format??t.series[0]?.number_format??"General",U=a.number_format??"General",x=r*.5,tt=chartScale(O(k),T(k),h.bottom-h.top,r*2.4,o),N=o.visible===!1?0:Math.max(0,...tt.ticks.map(p=>it(formatValue(p,D),r)))+x,B=a.visible===!1?0:r*1.2+x,M={x:h.left+N,y:h.top,width:h.right-h.left-N,height:h.bottom-h.top-B};c.plot=M,Bt(c,M,S,a.title,o.title,r,n);const E=chartScale(O(A),T(A),M.width,r*5,a),P=chartScale(O(k),T(k),M.height,r*2.4,o),H=p=>M.x+(Math.min(E.max,Math.max(E.min,p))-E.min)/(E.max-E.min)*M.width,C=p=>M.y+M.height-(Math.min(P.max,Math.max(P.min,p))-P.min)/(P.max-P.min)*M.height;for(const p of P.ticks){const v=C(p);(o.has_major_gridlines??!0)&&c.grid.push({d:`M${m(M.x)} ${m(v)} H${m(M.x+M.width)}`,color:o.gridline_color??{rgb:i.gridline},width:i.gridWidth}),o.visible!==!1&&c.words.push({x:M.x-x,y:v,text:formatValue(p,D),size:r,anchor:"end",color:n})}for(const p of E.ticks){const v=H(p);a.has_major_gridlines===!0&&c.grid.push({d:`M${m(v)} ${m(M.y)} V${m(M.y+M.height)}`,color:a.gridline_color??{rgb:i.gridline},width:i.gridWidth}),a.visible!==!1&&c.words.push({x:v,y:M.y+M.height+x+r*.6,text:formatValue(p,U),size:r,anchor:"middle",color:n})}c.axes.push({d:`M${m(M.x)} ${m(C(Math.max(P.min,Math.min(P.max,0))))} H${m(M.x+M.width)}`,color:a.line_color??{rgb:i.axisLine},width:i.gridWidth}),t.series.forEach((p,v)=>{const R=p.color??accentOf(v),z=(_[v]??[]).map(([Z,q])=>[H(Z),C(q)]);if(z.length!==0&&(hasLines(t.type)&&c.lines.push({d:t.type==="scatter-smooth"||p.smooth===!0?Nt(z):xt(z),color:R,width:p.line_width??i.lineWidth,series:v}),hasMarkers(t.type)))for(const[Z,q]of z)c.dots.push({x:Z,y:q,r:(p.marker_size??i.marker)/2,color:R})})}export function chartDrawing(t,c,h){const r=CHART_DEFAULTS,n=t.font_size??r.fontSize,i=t.font_color??"dk1",a={grid:[],shapes:[],boxes:[],lines:[],axes:[],dots:[],keys:[],words:[],plot:{x:0,y:0,width:0,height:0}},o={left:r.margin,top:r.margin,right:c-r.margin,bottom:h-r.margin};if(t.title!==void 0&&t.title!==""){const e=t.title_size??n*r.titleScale,s=t.title.split(`
|
|
3
|
-
`);s.forEach((g,l)=>{a.words.push({x:c/2,y:o.top+e*(.7+l*1.2),text:g,size:e,anchor:"middle",color:i})}),o.top+=e*(1.6+(s.length-1)*1.2)}const S=isRound(t.type),_=variesOf(t),A=(e,s)=>_?t.category_colors?.[s]??accentOf(s):t.series[e]?.color??accentOf(e);if(t.legend!==void 0){const e=_?t.categories:t.series.map(d=>d.name),s=n*.6,g=n*.4,l=n*1.5,y=e.map(d=>s+g+it(d,n)),j=(d,w,f)=>{a.keys.push({x:w,y:f-s/2,width:s,height:s,color:_?t.category_colors?.[d]??accentOf(d):t.series[d]?.color??accentOf(d),series:_?0:d,category:_?d:0}),a.words.push({x:w+s+g,y:f,text:e[d]??"",size:n,anchor:"start",color:i})};if(t.legend==="top"||t.legend==="bottom"){const d=y.reduce((W,b)=>W+b,0)+n*(e.length-1),w=t.legend==="top"?o.top+l/2:o.bottom-l/2;let f=(c-d)/2;e.forEach((W,b)=>{j(b,f,w),f+=(y[b]??0)+n}),t.legend_overlay!==!0&&(t.legend==="top"?o.top+=l:o.bottom-=l)}else{const d=Math.max(0,...y),w=t.legend==="left"?o.left:o.right-d,f=(o.top+o.bottom-l*e.length)/2+l/2;e.forEach((W,b)=>{j(b,w,f+b*l)}),t.legend_overlay!==!0&&(t.legend==="left"?o.left+=d+n:o.right-=d+n)}}const k=t.labels,O=k?.size??n,T=k?.color??i,D=(e,s,g,l,y=T)=>{g!==""&&a.words.push({x:e,y:s,text:g,size:O,anchor:l,color:y})};if(S){const e=t.series[0],s=(e?.values??[]).map(f=>Math.max(0,f??0)),g=s.reduce((f,W)=>f+W,0),l=Math.max(0,Math.min(o.right-o.left,o.bottom-o.top)/2),y=(o.left+o.right)/2,j=(o.top+o.bottom)/2,d=t.type==="doughnut"?l*((t.hole_size??r.holeSize)/100):0;a.plot={x:y-l,y:j-l,width:l*2,height:l*2};let w=0;return s.forEach((f,W)=>{const b=g>0?f/g:0,$=w+b*Math.PI*2;if(b>0){a.shapes.push({d:Kt(y,j,l,d,w,$),color:"lt1",width:1,fill:A(0,W),series:0,category:W});const I=(w+$)/2,V=d>0?(l+d)/2:labelPositionOf(t)==="inEnd"?l*.85:l*.6;e&&D(y+V*Math.sin(I),j-V*Math.cos(I),yt(t,f,b,e,t.categories[W]??""),"middle",k?.color??"lt1")}w=$}),a}if(isScatter(t.type))return Qt(t,a,o,n,i),a;const U=Math.max(1,t.categories.length),x=isHorizontal(t.type),tt=groupsOf(t),N=t.series.map(e=>t.categories.map((s,g)=>e.values[g]??null)),B=tt.map(e=>{const s=groupingOf(e.kind),g=s!=="clustered"&&s!=="standard",l=s==="percentStacked",y=t.categories.map((j,d)=>e.series.reduce((w,f)=>w+Math.abs(N[f]?.[d]??0),0));return{...e,stacked:g,percent:l,totals:y}}),M=(e,s,g)=>{const l=N[s]?.[g];if(l==null)return null;const y=e.totals[g]??0;return e.percent?y>0?l/y:0:l},E=e=>{let s=0,g=0,l=1/0,y=!1;for(const f of B)if(f.secondary===e&&(y||=f.percent,t.categories.forEach((W,b)=>{let $=0,I=0;for(const V of f.series){const L=M(f,V,b)??0;f.stacked?L>=0?$+=L:I+=L:($=Math.max($,L),I=Math.min(I,L))}g=Math.max(g,$),s=Math.min(s,I)}),!f.stacked))for(const W of f.series)for(const b of N[W]??[])b!==null&&(l=Math.min(l,b));B.every(f=>f.secondary!==e||!f.stacked)&&Number.isFinite(l)&&l>0&&(s=l),y&&(g=1,s=Math.min(s,0));const d=B.find(f=>f.secondary===e),w=d===void 0?void 0:d.series[0];return{low:s,high:g,percent:y,format:w===void 0?void 0:t.series[w]?.number_format}},P=E(!1),H=B.some(e=>e.secondary)?E(!0):void 0,C=t.value_axis??{},p=t.secondary_axis??{},v=t.category_axis??{},R=C.number_format??(P.percent?"0%":P.format??"General"),z=p.number_format??(H?.percent===!0?"0%":H?.format??"General"),Z=(e,s,g,l)=>chartScale(e.low,e.high,g,l,{...s,...e.percent?{maximum_scale:s.maximum_scale??1}:{}}),q=x?o.right-o.left:o.bottom-o.top,at=x?n*5:n*2.4,Dt=Z(P,C,q,at),bt=C.visible===!1?[]:Dt.ticks.map(e=>formatValue(e,R)),wt=Math.max(0,...bt.map(e=>it(e,n))),Mt=H===void 0||p.visible===!1?0:Math.max(0,...Z(H,p,q,at).ticks.map(e=>it(formatValue(e,z),n))),ct=v.visible!==!1,_t=ct?Math.max(0,...t.categories.map(e=>it(e,n))):0,G=n*.5,$t=x?C.title:v.title,kt=x?v.title:C.title,Ht=Tt(o,$t,kt,n),lt=H===void 0?void 0:p.title,vt=n*1.5,Wt=lt!==void 0&<!==""?(o.right-=vt)+vt/2:void 0,u=x?{x:o.left+(ct?_t+G:0),y:o.top,width:0,height:o.bottom-o.top-(C.visible===!1?0:n*1.2+G)}:{x:o.left+(C.visible===!1?0:wt+G),y:o.top,width:0,height:o.bottom-o.top-(ct?n*1.2+G:0)};u.width=o.right-u.x-(x&&bt.length>0?wt/2:0)-(Mt>0?Mt+G:0),a.plot=u,Bt(a,u,Ht,$t,kt,n,i),Wt!==void 0&<!==void 0&&a.words.push({x:Wt,y:u.y+u.height/2,text:lt,size:n,anchor:"middle",color:i,rotate:-90});const ut=x?u.width:u.height,et=Z(P,C,ut,at),nt=H===void 0?void 0:Z(H,p,ut,at),Et=(e,s)=>(Math.min(e.max,Math.max(e.min,s))-e.min)/(e.max-e.min)*ut,mt=(e,s)=>x?u.x+Et(e,s):u.y+u.height-Et(e,s),St=e=>mt(et,e),At=B.every(e=>isArea(e.kind)),Ot=v.reverse_order===!0,Pt=x?!Ot:Ot,pt=(x?u.height:u.width)/U,Ct=At?(x?u.height:u.width)/Math.max(1,U-1):pt,gt=e=>{const s=At?e*Ct:(e+.5)*pt,g=x?u.height:u.width,l=Pt?g-s:s;return(x?u.y:u.x)+l},It=St(Math.max(et.min,Math.min(et.max,0)));for(const e of et.ticks){const s=St(e);(C.has_major_gridlines??!0)&&a.grid.push({d:x?`M${m(s)} ${m(u.y)} V${m(u.y+u.height)}`:`M${m(u.x)} ${m(s)} H${m(u.x+u.width)}`,color:C.gridline_color??{rgb:r.gridline},width:r.gridWidth}),C.visible!==!1&&a.words.push(x?{x:s,y:u.y+u.height+G+n*.6,text:formatValue(e,R),size:n,anchor:"middle",color:i}:{x:u.x-G,y:s,text:formatValue(e,R),size:n,anchor:"end",color:i})}if(nt&&p.visible!==!1)for(const e of nt.ticks)a.words.push({x:u.x+u.width+G,y:mt(nt,e),text:formatValue(e,z),size:n,anchor:"start",color:i});if(a.axes.push({d:x?`M${m(It)} ${m(u.y)} V${m(u.y+u.height)}`:`M${m(u.x)} ${m(It)} H${m(u.x+u.width)}`,color:v.line_color??{rgb:r.axisLine},width:r.gridWidth}),ct){const e=x?n*1.3:_t+n,s=Math.max(1,Math.ceil(e/Math.max(1,Ct)));t.categories.forEach((g,l)=>{if(l%s!==0)return;const y=gt(l);a.words.push(x?{x:u.x-G,y,text:g,size:n,anchor:"end",color:i}:{x:y,y:u.y+u.height+G+n*.6,text:g,size:n,anchor:"middle",color:i})})}for(const e of B){const s=e.secondary&&nt?nt:et,g=y=>mt(s,y),l={type:e.kind,...t.labels===void 0?{}:{labels:t.labels}};isBar(e.kind)?zt(e,g,l):Gt(e,g,l)}return a;function zt(e,s,g){const l=(t.gap_width??r.gapWidth)/100,y=e.stacked?1:e.series.length,j=e.stacked?1:(t.overlap??0)/100,d=pt/(Math.max(1,y-(y-1)*j)+l),w=d*(1-j),f=d+w*(y-1);t.categories.forEach((W,b)=>{const $=gt(b);let I=0,V=0;e.series.forEach((L,ot)=>{const J=t.series[L],F=M(e,L,b);if(F===null||!J)return;const ht=e.stacked?F>=0?I:V:0,st=ht+F;e.stacked&&(F>=0?I=st:V=st);const K=s(ht),Q=s(st),dt=(e.stacked?$-d/2:$-f/2+ot*w)+(x&&Pt&&!e.stacked?f-d-2*ot*w:0),Vt=x?{x:Math.min(K,Q),y:dt,width:Math.abs(Q-K),height:d}:{x:dt,y:Math.min(K,Q),width:d,height:Math.abs(Q-K)};if(a.boxes.push({...Vt,color:A(L,b),series:L,category:b}),!k)return;const Lt=yt(t,N[L]?.[b]??0,0,J,t.categories[b]??""),ft=labelPositionOf(g),X=O*.8,Rt=F>=0?1:-1,Ft=(rt,Y)=>ft==="ctr"?(rt+Y)/2:ft==="inBase"?rt+(Y>rt?X:-X):ft==="inEnd"?Y-(Y>rt?X:-X):Y+(Y>=rt?X:-X);x?D(Ft(K,Q),dt+d/2,Lt,ft==="outEnd"?Rt>0?"start":"end":"middle"):D(dt+d/2,Ft(K,Q),Lt,"middle")})})}function Gt(e,s,g){const l=t.categories.map(()=>0),y=e.series.map(d=>{const w=t.series[d],f=[],W=[];return t.categories.forEach((b,$)=>{const I=M(e,d,$);if(I===null||!w)return;const V=e.stacked?l[$]??0:0,L=V+I;e.stacked&&(l[$]=L);const ot=gt($),J=F=>x?[s(F),ot]:[ot,s(F)];if(f.push(J(L)),W.push(J(V)),isLine(e.kind)&&k){const F=labelPositionOf(g),[ht,st]=J(L);D(ht+(F==="r"?O:F==="l"?-O:0),st+(F==="t"?-O:F==="b"?O:0),yt(t,N[d]?.[$]??0,0,w,t.categories[$]??""),F==="r"?"start":F==="l"?"end":"middle")}}),{series:w,s:d,points:f,base:W}}),j=[];for(const{series:d,s:w,points:f,base:W}of y){if(!d)continue;const b=d.color??accentOf(w);if(isArea(e.kind)&&f.length>0)j.push({d:`${xt([...f,...[...W].reverse()])} Z`,color:b,width:0,fill:b,series:w});else if(f.length>0&&(a.lines.push({d:d.smooth===!0?Nt(f):xt(f),color:b,width:d.line_width??r.lineWidth,series:w}),hasMarkers(e.kind)))for(const[$,I]of f)a.dots.push({x:$,y:I,r:(d.marker_size??r.marker)/2,color:b})}a.shapes.push(...j.reverse())}}
|
|
2
|
+
import{format as fe,isValidFormat as me}from"numfmt";import{acrossDrawing as pe,isAcross as ge,isRadar as xe,isRecipe as _e,isStock as ye,radarDrawing as be,recipeDef as Me,stockDrawing as we}from"./classic.js";import{categoryFrame as ke,extendedDrawing as $e,extendedLegend as ve,isExtended as re}from"./extended.js";export const DASH_ARRAYS={solid:[],dot:[1,3],dash:[4,3],lgDash:[8,3],dashDot:[4,3,1,3],lgDashDot:[8,3,1,3],lgDashDotDot:[8,3,1,3,1,3],sysDash:[3,1],sysDot:[1,1],sysDashDot:[3,1,1,1],sysDashDotDot:[3,1,1,1,1,1]};export function seeThrough(t,a){if(a===void 0||a<=0)return t;const l={name:"alpha",value:Math.max(0,1-a)};return typeof t=="string"?{theme_color:t,transforms:[l]}:"rgb"in t?{rgb:t.rgb,transforms:[...t.transforms??[],l]}:"transforms"in t?{theme_color:t.theme_color,transforms:[...t.transforms,l]}:t}export function markerPath(t,a,l,c){const o=n=>`M${n.map(([p,r])=>`${d(a+p*c)} ${d(l+r*c)}`).join(" L")} Z`;switch(t){case void 0:case"circle":case"none":return;case"square":return o([[-1,-1],[1,-1],[1,1],[-1,1]]);case"diamond":return o([[0,-1.2],[1.2,0],[0,1.2],[-1.2,0]]);case"triangle":return o([[0,-1.2],[1.1,.9],[-1.1,.9]]);case"dash":return o([[-1,-.25],[1,-.25],[1,.25],[-1,.25]]);case"dot":return o([[-.4,-.4],[.4,-.4],[.4,.4],[-.4,.4]]);case"plus":return o([[-.25,-1],[.25,-1],[.25,-.25],[1,-.25],[1,.25],[.25,.25],[.25,1],[-.25,1],[-.25,.25],[-1,.25],[-1,-.25],[-.25,-.25]]);case"x":return o([[-1,-.7],[-.7,-1],[0,-.3],[.7,-1],[1,-.7],[.3,0],[1,.7],[.7,1],[0,.3],[-.7,1],[-1,.7],[-.3,0]]);case"star":{const n=[];for(let p=0;p<10;p++){const r=-Math.PI/2+p*Math.PI/5,h=p%2===0?1.2:.5;n.push([Math.cos(r)*h,Math.sin(r)*h])}return o(n)}}}export function pointLabelPosition(t,a){const l=t[a];if(l==null)return"t";const c=t[a-1],o=t[a+1],n=p=>p!=null;return!n(c)||!n(o)?n(c)&&l<c||n(o)&&l<o?"b":"t":l<c&&l<o?"b":l>c&&l>o?"t":l>c?"l":"r"}export const DISPLAY_UNITS={hundreds:100,thousands:1e3,tenThousands:1e4,hundredThousands:1e5,millions:1e6,tenMillions:1e7,hundredMillions:1e8,billions:1e9,trillions:1e12},DISPLAY_UNIT_WORDS={hundreds:"Hundreds",thousands:"Thousands",tenThousands:"10000",hundredThousands:"100000",millions:"Millions",tenMillions:"10000000",hundredMillions:"100000000",billions:"Billions",trillions:"Trillions"};export function labelsAt(t,a,l){const c=a.labels===void 0?t.labels:a.labels;if(c)return c.points===void 0||c.points.includes(l)?c:void 0}export const CHART_INK="tx1",CHART_GRID={theme_color:"tx1",transforms:[{name:"alpha",value:.15}]},CHART_AXIS={theme_color:"tx1",transforms:[{name:"alpha",value:.25}]},CHART_DEFAULTS={fontSize:12,titleScale:1.2,gapWidth:150,holeSize:50,margin:6,gridline:"#D9D9D9",axisLine:"#BFBFBF",letter:.55,lineWidth:2.25,gridWidth:.75,marker:5};const ie=["accent1","accent2","accent3","accent4","accent5","accent6"];export const accentOf=t=>ie[t%ie.length]??"accent1",isBar=t=>t.startsWith("column")||t.startsWith("bar"),isHorizontal=t=>t.startsWith("bar"),isLine=t=>t.startsWith("line"),isArea=t=>t.startsWith("area"),isRound=t=>t==="pie"||t==="doughnut",isScatter=t=>t.startsWith("scatter")||t==="bubble",hasLines=t=>!isScatter(t)||t!=="scatter"&&t!=="bubble",hasMarkers=t=>t==="line-markers"||t==="scatter"||t==="scatter-lines"||t==="radar-markers",groupingOf=t=>t.endsWith("-100")?"percentStacked":t.endsWith("-stacked")?"stacked":isBar(t)?"clustered":"standard";export function labelPositionsOf(t){return isArea(t)||t==="doughnut"||t==="box-whisker"||t.startsWith("radar")||t.startsWith("stock")?[]:t==="waterfall"?["outEnd","inEnd","ctr","inBase"]:t==="pie"?["bestFit","outEnd","inEnd","ctr"]:isLine(t)||isScatter(t)?["t","b","l","r","ctr"]:groupingOf(t)==="clustered"?["outEnd","inEnd","ctr","inBase"]:["inEnd","ctr","inBase"]}export function labelPositionOf(t){const a=labelPositionsOf(t.type),l=t.labels?.position;if(l!==void 0&&a.includes(l))return l;if(a.length!==0)return t.type==="pie"?"ctr":t.type==="waterfall"?"outEnd":isLine(t.type)||isScatter(t.type)?"t":groupingOf(t.type)==="clustered"?"outEnd":"ctr"}export const isCombinable=t=>t.startsWith("column")||isLine(t)||isArea(t);export function groupsOf(t){const a=isCombinable(t.type),l=[];if(t.series.forEach((o,n)=>{const r=o.type!==void 0&&a&&isCombinable(o.type)?o.type??t.type:t.type,h=a&&o.secondary===!0,B=l.find(j=>j.kind===r&&j.secondary===h);B?B.series.push(n):l.push({kind:r,secondary:h,series:[n]})}),l.every(o=>o.secondary))for(const o of l)o.secondary=!1;const c=o=>(o.secondary?3:0)+(isArea(o.kind)?0:isBar(o.kind)?1:2);return l.sort((o,n)=>c(o)-c(n))}export const variesOf=t=>t.vary_by_categories??isRound(t.type);export function formatValue(t,a="General"){return a==="General"||!me(a)?String(Number(t.toPrecision(10))):fe(a,t)}export function scaleShare(t,a){const l=Math.min(t.max,Math.max(t.min,a));if(t.log!==void 0){const c=Math.log(t.min),o=Math.log(t.max);return o>c?(Math.log(Math.max(l,t.min))-c)/(o-c):0}return t.max>t.min?(l-t.min)/(t.max-t.min):0}const We=[1,2,5,10];export function chartScale(t,a,l,c,o={}){const n=o.log_base;if(n!==void 0&&n>=2){const F=t>0?t:a>0?Math.min(a,1):1,q=(it,mt)=>n**mt(Number((Math.log(it)/Math.log(n)).toFixed(9))),g=o.minimum_scale??q(F,Math.floor),C=Math.max(o.maximum_scale??q(Math.max(a,F),Math.ceil),g*n),S=[];for(let it=g;it<=C*(1+1e-9);it*=n)S.push(Number(it.toPrecision(12)));return{min:g,max:C,major:n,ticks:S,log:n}}const p=t>0&&(a-t)/a<1/6?t:Math.min(t,0),r=a<=0&&t<0?0:a,h=o.minimum_scale??p,B=o.maximum_scale??r,j=B>h?B-h:1,V=Math.max(1,Math.floor(l/c)),Q=j/V,L=10**Math.floor(Math.log10(Q)),st=(We.find(F=>F*L>=Q)??10)*L,G=o.major_unit,Y=G!==void 0&&G>0&&j/G<=1e3?G:st,tt=(F,q)=>Number((q(Number((F/Y).toFixed(9)))*Y).toPrecision(12)),M=r>0?r+j*.05:r===p?j:r,yt=o.maximum_scale??tt(M,Math.ceil),rt=p<0?p-j*.05:p,Z=o.minimum_scale??tt(rt,Math.floor),K=[],bt=Math.round((yt-Z)/Y);for(let F=0;F<=bt;F++)K.push(Number((Z+F*Y).toPrecision(12)));return{min:Z,max:yt,major:Y,ticks:K}}const Ee=[278,278,355,556,556,889,667,191,333,333,389,584,278,333,278,278,556,556,556,556,556,556,556,556,556,556,278,278,584,584,584,556,1015,667,667,722,722,667,611,778,722,278,500,667,556,833,722,778,667,778,722,667,611,722,667,944,667,667,611,278,278,278,469,556,333,556,556,500,556,556,278,556,556,222,222,500,222,833,556,556,556,556,333,500,278,556,500,722,500,500,500,334,260,334,584];export function wrapWords(t,a,l,c=textWidth){const o=[];let n="";for(const p of t.split(/\s+/u).filter(r=>r!=="")){const r=n===""?p:`${n} ${p}`;n!==""&&c(r,l)>a?(o.push(n),n=p):n=r}return o.push(n),o}export const textWidth=(t,a)=>{let l=0;for(const c of t){const o=c.codePointAt(0)??0,n=Ee[o-32];l+=n!==void 0?n/1e3:o>11903?1:CHART_DEFAULTS.letter}return l*a};const d=t=>String(Number(t.toFixed(3)));function ae(t){const a=l=>t[Math.max(0,Math.min(t.length-1,l))]??[0,0];return t.map(([l,c],o)=>{if(o===0)return`M${d(l)} ${d(c)}`;const[n,p]=a(o-2),[r,h]=a(o-1),[B,j]=a(o+1),V=`${d(r+(l-n)/6)} ${d(h+(c-p)/6)}`,Q=`${d(l-(B-r)/6)} ${d(c-(j-h)/6)}`;return`C${V} ${Q} ${d(l)} ${d(c)}`}).join(" ")}const zt=t=>t.map(([a,l],c)=>`${c===0?"M":"L"}${d(a)} ${d(l)}`).join(" ");function Se(t,a,l,c,o,n){const p=(j,V)=>`${d(t+j*Math.sin(V))} ${d(a-j*Math.cos(V))}`,r=n-o>=Math.PI*2?o+Math.PI*2-1e-4:n,h=r-o>Math.PI?1:0,B=`M${p(l,o)} A${d(l)} ${d(l)} 0 ${String(h)} 1 ${p(l,r)}`;return c<=0?`${B} L${d(t)} ${d(a)} Z`:`${B} L${p(c,r)} A${d(c)} ${d(c)} 0 ${String(h)} 0 ${p(c,o)} Z`}export function axisTitleRoom(t,a,l,c){const o=c*1.5;return a!==void 0&&a!==""&&(t.bottom-=o),l!==void 0&&l!==""&&(t.left+=o),{x:t.left-o/2,y:t.bottom+o/2}}export function axisTitleWords(t,a,l,c,o,n,p){c!==void 0&&c!==""&&t.words.push({x:a.x+a.width/2,y:l.y,text:c,size:n,anchor:"middle",color:p}),o!==void 0&&o!==""&&t.words.push({x:l.x,y:a.y+a.height/2,text:o,size:n,anchor:"middle",color:p,rotate:-90})}const Ot=(t,a,l,c,o,n)=>{if(!n)return"";const p=isRound(t.type),r=[];return n.show_series_name&&r.push(c.name),n.show_category_name&&r.push(o),(n.show_value??!(n.show_percentage??!1))&&r.push(formatValue(a,n.number_format??c.number_format)),n.show_percentage&&p&&r.push(formatValue(l,n.number_format??"0%")),r.join(", ")};function De(t,a,l,c,o,n=textWidth){const p=CHART_DEFAULTS,r=t.category_axis??{},h=t.value_axis??{},B=axisTitleRoom(l,r.title,h.title,c),j=Math.max(1e-9,...t.series.flatMap(b=>b.values.flatMap((T,et)=>{const X=b.x?.[et]??(b.x?null:et+1);return T===null||X===null?[]:[b.sizes?.[et]??1]}))),V=t.series.map(b=>b.values.flatMap((T,et)=>{const X=b.x?.[et]??(b.x?null:et+1);return X===null||T===null?[]:[[X,T]]})),Q=V.flat().map(b=>b[0]),L=V.flat().map(b=>b[1]),st=b=>b.length>0?Math.min(...b):0,G=b=>b.length>0?Math.max(...b):1,Y=h.number_format??t.series[0]?.number_format??"General",tt=r.number_format??"General",M=c*.5,yt=chartScale(st(L),G(L),l.bottom-l.top,c*2.4,h),rt=h.visible!==!1&&h.tick_label_position!=="none",Z=r.visible!==!1&&r.tick_label_position!=="none",K=rt?Math.max(0,...yt.ticks.map(b=>n(formatValue(b,Y),c)))+M:0,bt=Z?c*1.2+M:0,F=chartScale(st(Q),G(Q),l.right-l.left-K,c*5,r),q=Z?n(formatValue(F.max,tt),c)/2:0,g={x:l.left+K,y:l.top,width:l.right-l.left-K-q,height:l.bottom-l.top-bt};a.plot=g,axisTitleWords(a,g,B,r.title,h.title,c,o);const C=chartScale(st(Q),G(Q),g.width,c*5,r),S=chartScale(st(L),G(L),g.height,c*2.4,h),it=b=>g.x+(Math.min(C.max,Math.max(C.min,b))-C.min)/(C.max-C.min)*g.width,mt=b=>g.y+g.height-(Math.min(S.max,Math.max(S.min,b))-S.min)/(S.max-S.min)*g.height;for(const b of S.ticks){const T=mt(b);(h.has_major_gridlines??!0)&&a.grid.push({d:`M${d(g.x)} ${d(T)} H${d(g.x+g.width)}`,color:h.gridline_color??CHART_GRID,width:p.gridWidth}),rt&&a.words.push({x:g.x-M,y:T,text:formatValue(b,Y),size:c,anchor:"end",color:o})}for(const b of C.ticks){const T=it(b);r.has_major_gridlines===!0&&a.grid.push({d:`M${d(T)} ${d(g.y)} V${d(g.y+g.height)}`,color:r.gridline_color??CHART_GRID,width:p.gridWidth}),Z&&a.words.push({x:T,y:g.y+g.height+M+c*.6,text:formatValue(b,tt),size:c,anchor:"middle",color:o})}const xt=(b,T)=>b.crosses_at??(b.crosses==="min"?T.min:b.crosses==="max"?T.max:Math.max(T.min,Math.min(T.max,0)));a.axes.push({d:`M${d(g.x)} ${d(mt(xt(h,S)))} H${d(g.x+g.width)}`,color:r.line_color??CHART_AXIS,width:p.gridWidth}),(r.crosses_at!==void 0||r.crosses!==void 0)&&a.axes.push({d:`M${d(it(xt(r,C)))} ${d(g.y)} V${d(g.y+g.height)}`,color:h.line_color??CHART_AXIS,width:p.gridWidth}),t.series.forEach((b,T)=>{const et=b.color??accentOf(T),X=(V[T]??[]).map(([nt,A])=>[it(nt),mt(A)]);if(X.length!==0){if(hasLines(t.type)&&a.lines.push({d:t.type==="scatter-smooth"||b.smooth===!0?ae(X):zt(X),color:et,width:b.line_width??p.lineWidth,series:T}),hasMarkers(t.type))for(const[nt,A]of X)a.dots.push({x:nt,y:A,r:(b.marker_size??p.marker)/2,color:et});if(t.type==="bubble"){const nt=b.values.flatMap((A,at)=>{const U=b.x?.[at]??(b.x?null:at+1);return A===null||U===null?[]:[b.sizes?.[at]??1]});X.forEach(([A,at],U)=>{const pt=Math.max(0,nt[U]??0);a.dots.push({x:A,y:at,r:Math.sqrt(pt/j)*Math.min(g.width,g.height)/8,color:seeThrough(et,b.transparency??.25)})})}(V[T]??[]).forEach(([nt,A],at)=>{const U=labelsAt(t,b,at),pt=X[at];if(!U||!pt)return;const ct=Ot(t,A,0,b,String(nt),U);if(ct==="")return;const gt=U.size??c,ot=(b.marker_size??p.marker)/2+gt*.3,ut=U.position??"r";a.words.push({x:pt[0]+(ut==="r"?ot:ut==="l"?-ot:0),y:pt[1]+(ut==="t"?-ot-gt*.4:ut==="b"?ot+gt*.4:0),text:ct,size:gt,anchor:ut==="r"?"start":ut==="l"?"end":"middle",color:U.color??o,...U.bold===!0?{bold:!0}:{}})})}})}export function chartDrawing(t,a,l,c=textWidth){if(_e(t.type))return ge(t)?pe(t,a,l):chartDrawing(Me(t,l),a,l,c);const o=CHART_DEFAULTS,n=t.font_size??o.fontSize,p=t.font_color??CHART_INK,r={grid:[],shapes:[],boxes:[],lines:[],axes:[],dots:[],keys:[],words:[],plot:{x:0,y:0,width:0,height:0}},h={left:o.margin,top:o.margin,right:a-o.margin,bottom:l-o.margin};if(t.title!==void 0&&t.title!==""){const e=t.title_size??n*o.titleScale,s=(a-2*o.margin)*.92,x=t.title.split(`
|
|
3
|
+
`).flatMap(u=>wrapWords(u,s,e,c));x.forEach((u,k)=>{r.words.push({x:a/2,y:h.top+e*(.7+k*1.2),text:u,size:e,anchor:"middle",color:p})}),h.top+=e*(1.6+(x.length-1)*1.2)}const B=isRound(t.type),j=variesOf(t),V=(e,s)=>seeThrough(t.series[e]?.point_colors?.[s]??(j?t.category_colors?.[s]??accentOf(s):t.series[e]?.color??accentOf(e)),t.series[e]?.transparency);if(t.legend!==void 0){const e=re(t.type)?ve(t):void 0,s=e?e.map(f=>f.name):j?t.categories:t.series.map(f=>f.name),x=n*.6,u=n*.4,k=n*1.5,P=e||j?[]:groupsOf(t),w=f=>{const m=t.series[f],$=P.find(v=>v.series.includes(f))?.kind??t.type,D=isLine($)||isScatter($)&&$!=="bubble"||$==="radar"||$==="radar-markers";if(!m||!D)return;const W=Math.min(3,m.line_width??o.lineWidth),I=m.marker_symbol===void 0?hasMarkers($):m.marker_symbol!=="none";if(W<=0||$==="scatter"&&m.line_width===void 0)return I||$==="scatter"?{marker:!0}:void 0;const H=m.line_dash===void 0||m.line_dash==="solid"?void 0:DASH_ARRAYS[m.line_dash].map(v=>d(v*W)).join(" ");return{line:{width:W,...H===void 0?{}:{dash:H}},...I?{marker:!0}:{}}},_=f=>w(f)?.line?x*2.5:x,y=s.map((f,m)=>_(m)+u+c(f,n)),E=(f,m,$)=>{const D=w(f);r.keys.push({x:m,y:$-x/2,width:_(f),height:x,color:seeThrough(e?.[f]?.color??(j?t.category_colors?.[f]??accentOf(f):t.series[f]?.color??accentOf(f)),D?t.series[f]?.transparency:void 0),series:j?0:f,category:j?f:0,...D}),r.words.push({x:m+_(f)+u,y:$,text:s[f]??"",size:n,anchor:"start",color:p})};if(t.legend==="top"||t.legend==="bottom"){const f=Math.max(n*4,a-n*2),m=[[]];let $=0;s.forEach((W,I)=>{const H=y[I]??0,v=m[m.length-1]??[];v.length>0&&$+n+H>f?(m.push([I]),$=H):(v.push(I),$+=(v.length>1?n:0)+H)});const D=t.legend==="top"?h.top+k/2:h.bottom-k*m.length+k/2;m.forEach((W,I)=>{const H=W.reduce((N,R)=>N+(y[R]??0),0)+n*(W.length-1);let v=Math.max(n,(a-H)/2);for(const N of W)E(N,v,D+I*k),v+=(y[N]??0)+n}),t.legend_overlay!==!0&&(t.legend==="top"?h.top+=k*m.length:h.bottom-=k*m.length)}else{const f=Math.max(0,...y),m=t.legend==="left"?h.left:h.right-f,$=(h.top+h.bottom-k*s.length)/2+k/2;s.forEach((D,W)=>{E(W,m,$+W*k)}),t.legend_overlay!==!0&&(t.legend==="left"?h.left+=f+n:h.right-=f+n)}}const Q=t.labels,L=Q?.size??n,st=Q?.color??p,G=(e,s,x,u,k=st,P=!1,w=L)=>{x!==""&&r.words.push({x:e,y:s,text:x,size:w,anchor:u,color:k,...P?{bold:P}:{}})},Y=(e,s,x,u,k,P)=>{G(s,x,u,k,e.color??P??st,e.bold===!0,e.size??L)};if(B){const e=t.series[0],s=(e?.values??[]).map(y=>Math.max(0,y??0)),x=s.reduce((y,E)=>y+E,0),u=Math.max(0,Math.min(h.right-h.left,h.bottom-h.top)/2),k=(h.left+h.right)/2,P=(h.top+h.bottom)/2,w=t.type==="doughnut"?u*((t.hole_size??o.holeSize)/100):0;r.plot={x:k-u,y:P-u,width:u*2,height:u*2};let _=0;return s.forEach((y,E)=>{const f=x>0?y/x:0,m=_+f*Math.PI*2;if(f>0){r.shapes.push({d:Se(k,P,u,w,_,m),color:"lt1",width:1,fill:V(0,E),series:0,category:E});const $=(_+m)/2,D=w>0?(u+w)/2:labelPositionOf(t)==="inEnd"?u*.85:u*.6,W=e&&labelsAt(t,e,E);e&&W&&Y(W,k+D*Math.sin($),P-D*Math.cos($),Ot(t,y,f,e,t.categories[E]??"",W),"middle","lt1")}_=m}),r}if(isScatter(t.type))return De(t,r,h,n,p,c),r;if(re(t.type))return $e(t,r,h,n,p,c),r;if(xe(t.type))return be(t,r,h,n,p,c),r;if(ye(t.type))return we(t,r,(e,s)=>ke(t,r,h,n,p,e,s,t.categories,c)),r;const tt=Math.max(1,t.categories.length),M=isHorizontal(t.type),yt=groupsOf(t),rt=t.series.map(e=>t.categories.map((s,x)=>e.values[x]??null)),Z=yt.map(e=>{const s=groupingOf(e.kind),x=s!=="clustered"&&s!=="standard",u=s==="percentStacked",k=t.categories.map((P,w)=>e.series.reduce((_,y)=>_+Math.abs(rt[y]?.[w]??0),0));return{...e,stacked:x,percent:u,totals:k}}),K=(e,s,x)=>{const u=rt[s]?.[x];if(u==null)return null;const k=e.totals[x]??0;return e.percent?k>0?u/k:0:u},bt=e=>{let s=0,x=0,u=1/0,k=!1;for(const y of Z)if(y.secondary===e&&(k||=y.percent,t.categories.forEach((E,f)=>{let m=0,$=0;for(const D of y.series){const W=K(y,D,f)??0;y.stacked?W>=0?m+=W:$+=W:(m=Math.max(m,W),$=Math.min($,W))}x=Math.max(x,m),s=Math.min(s,$)}),!y.stacked))for(const E of y.series)for(const f of rt[E]??[])f!==null&&(u=Math.min(u,f));Z.every(y=>y.secondary!==e||!y.stacked)&&Number.isFinite(u)&&u>0&&(s=u),k&&(x=1,s=Math.min(s,0));const w=Z.find(y=>y.secondary===e),_=w===void 0?void 0:w.series[0];return{low:s,high:x,percent:k,format:_===void 0?void 0:t.series[_]?.number_format}},F=bt(!1),q=Z.some(e=>e.secondary)?bt(!0):void 0,g=t.value_axis??{},C=t.secondary_axis??{},S=t.category_axis??{},it=g.number_format??(F.percent?"0%":F.format??"General"),mt=C.number_format??(q?.percent===!0?"0%":q?.format??"General"),xt=(e,s,x,u)=>chartScale(e.low,e.high,x,u,{...s,...e.percent?{maximum_scale:s.maximum_scale??1}:{}}),b=M?h.right-h.left:h.bottom-h.top,T=M?n*5:n*2.4,et=xt(F,g,b,T),X=g.display_units===void 0?1:DISPLAY_UNITS[g.display_units],nt=e=>formatValue(e/X,it),A=g.visible===!1||g.tick_label_position==="none"?"none":g.tick_label_position==="high"||S.crosses==="max"!=(S.reverse_order===!0)?"high":"low",at=A==="none"?[]:et.ticks.map(e=>nt(e)),U=Math.max(0,...at.map(e=>c(e,n))),pt=q===void 0||C.visible===!1?0:Math.max(0,...xt(q,C,b,T).ticks.map(e=>c(formatValue(e,mt),n))),ct=S.visible!==!1&&S.tick_label_position!=="none",gt=ct?Math.max(0,...t.categories.map(e=>c(e,n))):0,ot=(S.label_angle??0)*Math.PI/180,ut=Math.abs(Math.sin(ot))*gt+Math.abs(Math.cos(ot))*n*1.2,z=n*.5,Ft=M?g.title:S.title,Vt=M?S.title:g.title,le=axisTitleRoom(h,Ft,Vt,n),Dt=q===void 0?void 0:C.title,Bt=n*1.5,Gt=Dt!==void 0&&Dt!==""?(h.right-=Bt)+Bt/2:void 0,At=S.tick_label_position==="high",Zt=A==="none"?0:n*1.2+z,qt=g.display_units!==void 0&&g.display_units_label!==!1&&A!=="none",Rt=qt&&!M?n*1.4:0,Ut=!M&&A!=="none"&&Rt===0&&!(ct&&At)&&h.top>o.margin?n*.6:0,i=M?{x:h.left+(ct&&!At?gt+z:0),y:h.top+(A==="high"?Zt:0),width:0,height:h.bottom-h.top-Zt}:{x:h.left+(A==="low"?U+z:0),y:h.top+Rt+Ut+(ct&&At?ut+z:0),width:0,height:h.bottom-h.top-Rt-Ut-(ct?ut+z:0)};i.width=h.right-i.x-(M&&at.length>0?U/2:0)-(!M&&A==="high"?U+z:0)-(M&&ct&&At?gt+z:0)-(pt>0?pt+z:0),r.plot=i,axisTitleWords(r,i,le,Ft,Vt,n,p),Gt!==void 0&&Dt!==void 0&&r.words.push({x:Gt,y:i.y+i.height/2,text:Dt,size:n,anchor:"middle",color:p,rotate:-90});const Ct=M?i.width:i.height,O=xt(F,g,Ct,T),_t=q===void 0?void 0:xt(q,C,Ct,T);r.scales={value:O,..._t?{secondary:_t}:{}};const Yt=(e,s)=>scaleShare(e,s)*Ct,Lt=(e,s)=>M?i.x+Yt(e,s):i.y+i.height-Yt(e,s),Nt=e=>Lt(O,e),Mt=Z.every(e=>isArea(e.kind)),Kt=S.reverse_order===!0,Tt=M?!Kt:Kt,Wt=(M?i.height:i.width)/tt,Pt=Mt?(M?i.height:i.width)/Math.max(1,tt-1):Wt,Et=e=>{const s=Mt?e*Pt:(e+.5)*Wt,x=M?i.height:i.width,u=Tt?x-s:s;return(M?i.y:i.x)+u},Xt=g.crosses_at??(g.crosses==="min"?O.min:g.crosses==="max"?O.max:O.log===void 0?0:O.min),St=Nt(Math.max(O.min,Math.min(O.max,Xt))),Jt=e=>M?`M${d(e)} ${d(i.y)} V${d(i.y+i.height)}`:`M${d(i.x)} ${d(e)} H${d(i.x+i.width)}`;if(g.has_minor_gridlines===!0){const e=[];if(O.log!==void 0)for(const x of O.ticks)for(let u=2;u<O.log;u++)x*u<O.max&&e.push(x*u);const s=g.minor_unit??O.major/5;if(O.log===void 0&&s>0)for(let x=O.min+s;x<O.max-s/2;x+=s)O.ticks.some(u=>Math.abs(u-x)<s/2)||e.push(x);for(const x of e)r.grid.push({d:Jt(Nt(x)),color:g.gridline_color??CHART_GRID,width:o.gridWidth/2})}if(S.has_major_gridlines===!0){const e=M?i.height:i.width;for(let s=0;s<=tt&&!(Mt&&s===tt);s++){const x=Mt?s*Pt:s*Wt,u=(M?i.y:i.x)+(Tt?e-x:x);r.grid.push({d:M?`M${d(i.x)} ${d(u)} H${d(i.x+i.width)}`:`M${d(u)} ${d(i.y)} V${d(i.y+i.height)}`,color:S.gridline_color??CHART_GRID,width:o.gridWidth})}}const It=(e,s,x,u,k)=>{if(e===void 0||e==="none")return;const P=n*.35,w=e==="in"?0:P,_=e==="out"?0:-P,[y,E]=[w*k,_*k];r.axes.push({d:u==="x"?`M${d(s+y)} ${d(x)} H${d(s+E)}`:`M${d(s)} ${d(x+y)} V${d(x+E)}`,color:g.line_color??CHART_AXIS,width:o.gridWidth})};for(const e of O.ticks){const s=Nt(e);(g.has_major_gridlines??!0)&&r.grid.push({d:Jt(s),color:g.gridline_color??CHART_GRID,width:o.gridWidth}),M?It(g.major_tick_mark,s,A==="high"?i.y:i.y+i.height,"y",A==="high"?-1:1):It(g.major_tick_mark,A==="high"?i.x+i.width:i.x,s,"x",A==="high"?1:-1),A!=="none"&&r.words.push(M?{x:s,y:A==="high"?i.y-z-n*.6:i.y+i.height+z+n*.6,text:nt(e),size:n,anchor:"middle",color:p}:A==="high"?{x:i.x+i.width+z,y:s,text:nt(e),size:n,anchor:"start",color:p}:{x:i.x-z,y:s,text:nt(e),size:n,anchor:"end",color:p})}if(qt&&g.display_units!==void 0&&r.words.push({x:M?i.x+i.width:A==="high"?h.right:h.left,y:M?i.y+i.height+z+n*1.8:i.y-n*.8,text:DISPLAY_UNIT_WORDS[g.display_units],size:n,anchor:M||A==="high"?"end":"start",color:p}),_t&&C.visible!==!1&&C.tick_label_position!=="none")for(const e of _t.ticks)r.words.push({x:i.x+i.width+z,y:Lt(_t,e),text:formatValue(e/(C.display_units===void 0?1:DISPLAY_UNITS[C.display_units]),mt),size:n,anchor:"start",color:p});S.visible!==!1&&r.axes.push({d:M?`M${d(St)} ${d(i.y)} V${d(i.y+i.height)}`:`M${d(i.x)} ${d(St)} H${d(i.x+i.width)}`,color:S.line_color??CHART_AXIS,width:o.gridWidth}),g.line_color!==void 0&&g.visible!==!1&&r.axes.push({d:M?`M${d(i.x)} ${d(i.y+i.height)} H${d(i.x+i.width)}`:`M${d(i.x)} ${d(i.y)} V${d(i.y+i.height)}`,color:g.line_color,width:o.gridWidth});for(let e=0;e<=tt&&S.visible!==!1;e++){const s=Mt?e*Pt:e*Wt;if(Mt&&e===tt)break;const x=M?i.height:i.width,u=(M?i.y:i.x)+(Tt?x-s:s);M?It(S.major_tick_mark,St,u,"x",-1):It(S.major_tick_mark,u,St,"y",1)}if(ct){const e=_=>M?n*1.3:Math.abs(Math.cos(ot))*c(_,n)+Math.abs(Math.sin(ot))*n,s=t.categories.map(e),x=_=>{for(let y=0;y+_<t.categories.length;y+=_)if(((s[y]??0)+(s[y+_]??0))/2+n>_*Pt)return!1;return!0};let u=S.label_interval??1;if(S.label_interval===void 0)for(;u<t.categories.length&&!x(u);)u++;const k=S.tick_label_position??"nextTo",P=M?i.x:i.y+i.height,w=k==="nextTo"?St:k==="high"?-1:P;t.categories.forEach((_,y)=>{if(y%u!==0)return;const E=Et(y),f=ot!==0&&!M;r.words.push(M?k==="high"?{x:i.x+i.width+z,y:E,text:_,size:n,anchor:"start",color:p}:{x:Math.min(w,i.x+i.width)-z,y:E,text:_,size:n,anchor:"end",color:p}:k==="high"?{x:E,y:i.y-z-n*.6,text:_,size:n,anchor:"middle",color:p}:{x:E,y:Math.max(w,i.y)+z+n*.6,text:_,size:n,anchor:f?ot>0?"start":"end":"middle",color:p,...f?{rotate:ot*180/Math.PI}:{}})})}for(const e of Z){const s=e.secondary&&_t?_t:O,x=k=>Lt(s,k),u={type:e.kind,...t.labels===void 0?{}:{labels:t.labels}};isBar(e.kind)?ce(e,x,u):de(e,x,u)}return r;function ce(e,s,x){const u=Math.max(O.min,Math.min(O.max,Xt)),k=((e.secondary?t.secondary_gap_width??t.gap_width:t.gap_width)??o.gapWidth)/100,P=e.stacked?1:e.series.length,w=e.stacked?1:(t.overlap??0)/100,_=Wt/(Math.max(1,P-(P-1)*w)+k),y=_*(1-w),E=_+y*(P-1);t.categories.forEach((f,m)=>{const $=Et(m);let D=0,W=0;e.series.forEach((I,H)=>{const v=t.series[I],N=K(e,I,m);if(N===null||!v)return;const R=e.stacked?N>=0?D:W:e.secondary?0:u,dt=e.stacked?R+N:N;e.stacked&&(N>=0?D=dt:W=dt);const ht=s(R),J=s(dt),wt=(e.stacked?$-_/2:$-E/2+H*y)+(M&&Tt&&!e.stacked?E-_-2*H*y:0),he=M?{x:Math.min(ht,J),y:wt,width:Math.abs(J-ht),height:_}:{x:wt,y:Math.min(ht,J),width:_,height:Math.abs(J-ht)};r.boxes.push({...he,color:V(I,m),series:I,category:m,...v.no_fill===!0?{hollow:!0}:{}});const Qt=v.point_labels?.find(lt=>lt.index===m);if(Qt!==void 0){const lt=Qt.text.split(`
|
|
4
|
+
`),ft=L*.9,ne=L*1.2,Ht=N>=0?1:-1;lt.forEach((oe,vt)=>{const se=vt===0?v.color??accentOf(I):st;M?G(J+Ht*ft,wt+_/2+(vt-(lt.length-1)/2)*ne,oe,Ht>0?"start":"end",se,vt===0):G(wt+_/2,J-Ht*(ft+L*.5)+(Ht>0?vt-(lt.length-1):vt)*ne,oe,"middle",se,vt===0)});return}const kt=labelsAt(t,v,m);if(!kt)return;const te=Ot(t,rt[I]?.[m]??0,0,v,t.categories[m]??"",kt),jt=labelPositionOf({...x,labels:kt}),$t=(kt.size??L)*.8,ue=N>=0?1:-1,ee=(lt,ft)=>jt==="ctr"?(lt+ft)/2:jt==="inBase"?lt+(ft>lt?$t:-$t):jt==="inEnd"?ft-(ft>lt?$t:-$t):ft+(ft>=lt?$t:-$t);M?Y(kt,ee(ht,J),wt+_/2,te,jt==="outEnd"?ue>0?"start":"end":"middle"):Y(kt,wt+_/2,ee(ht,J),te,"middle")})})}function de(e,s,x){const u=t.categories.map(()=>0),k=e.series.map(w=>{const _=t.series[w],y=[],E=[];t.categories.forEach((f,m)=>{const $=K(e,w,m);if($===null||!_)return;const D=e.stacked?u[m]??0:0,W=D+$;e.stacked&&(u[m]=W);const I=Et(m),H=R=>M?[s(R),I]:[I,s(R)];y.push(H(W)),E.push(H(D));const v=labelsAt(t,_,m),N=_.point_labels?.some(R=>R.index===m)===!0;if(isLine(e.kind)&&v&&!N){const R=v.position===void 0?pointLabelPosition(rt[w]??[],m)==="b"?"b":"t":labelPositionOf({...x,labels:v}),[dt,ht]=H(W),J=v.size??L;Y(v,dt+(R==="r"?J:R==="l"?-J:0),ht+(R==="t"?-J:R==="b"?J:0),Ot(t,rt[w]?.[m]??0,0,_,t.categories[m]??"",v),R==="r"?"start":R==="l"?"end":"middle")}});for(const f of _?.point_labels??[]){const m=K(e,w,f.index);if(m===null||!_||isArea(e.kind))continue;const $=0,D=Et(f.index),[W,I]=M?[s($+m),D]:[D,s($+m)];r.dots.push({x:W,y:I,r:Math.max(3,(_.line_width??o.lineWidth)*1.6),color:_.color??accentOf(w)});const H=f.text.split(`
|
|
5
|
+
`),v=L*.9,N=L*1.2;H.forEach((R,dt)=>{const ht=f.position==="t"?dt-(H.length-1):dt;G(W+(f.dx??0)*a+(f.position==="r"?v:f.position==="l"?-v:0),I+(f.position==="t"?-v-L*.5:f.position==="b"?v+L*.5:0)+(f.dy??0)*l+ht*N,R,f.position==="r"?"start":f.position==="l"||f.index===t.categories.length-1?"end":f.index===0?"start":"middle",dt===0?_.color??accentOf(w):st,dt===0)})}return{series:_,s:w,points:y,base:E}}),P=[];for(const{series:w,s:_,points:y,base:E}of k){if(!w)continue;const f=seeThrough(w.color??accentOf(_),w.transparency),m=w.line_width??o.lineWidth,$=w.line_dash===void 0||w.line_dash==="solid"?void 0:DASH_ARRAYS[w.line_dash].map(D=>d(D*m)).join(" ");if(isArea(e.kind)&&y.length>0)P.push({d:`${zt([...y,...[...E].reverse()])} Z`,color:f,width:w.no_fill===!0?m/2:0,...w.no_fill===!0?{}:{fill:f},series:_});else if(y.length>0&&(m>0&&r.lines.push({d:w.smooth===!0?ae(y):zt(y),color:f,width:m,...$===void 0?{}:{dash:$},series:_}),w.marker_symbol===void 0?hasMarkers(e.kind):w.marker_symbol!=="none")){const W=(w.marker_size??o.marker)/2,I=t.categories.flatMap((H,v)=>K(e,_,v)===null?[]:[v]);y.forEach(([H,v],N)=>{const R=markerPath(w.marker_symbol,H,v,W);r.dots.push({x:H,y:v,r:W,color:V(_,I[N]??N),...R===void 0?{}:{d:R}})})}}r.shapes.push(...P.reverse()),t.high_low_lines===!0&&isLine(e.kind)&&t.categories.forEach((w,_)=>{const y=e.series.flatMap($=>{const D=K(e,$,_);return D===null?[]:[D]});if(y.length<2)return;const E=Et(_),[f,m]=[s(Math.max(...y)),s(Math.min(...y))];r.grid.push({d:M?`M${d(f)} ${d(E)} H${d(m)}`:`M${d(E)} ${d(f)} V${d(m)}`,color:CHART_AXIS,width:o.lineWidth})})}}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
+
import{colorXml as C}from"./color.js";import{accentOf as T,CHART_AXIS as X,CHART_DEFAULTS as u,CHART_GRID as k,CHART_INK as I,labelPositionOf as $,seeThrough as h}from"./chart.js";import{FUNNEL_GAP as D}from"./tree.js";import{BOX_LOOK as y,HISTOGRAM_EDGE as O,isBinned as p,isHierarchical as H,PARETO_GAP as F,PARETO_LINE as M,WATERFALL_GAP as N,withTotals as U}from"./extended.js";const _="http://schemas.microsoft.com/office/drawing/2014/chartex",g="http://schemas.openxmlformats.org/drawingml/2006/main",P="http://schemas.openxmlformats.org/officeDocument/2006/relationships",b=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
3
|
+
`,j={waterfall:"waterfall","box-whisker":"boxWhisker",histogram:"clusteredColumn",pareto:"clusteredColumn",treemap:"treemap",sunburst:"sunburst",funnel:"funnel"};export const CHARTEX_REQUIRES={prefix:"cx1",namespace:"http://schemas.microsoft.com/office/drawing/2015/9/8/chartex"},chartExRequires=t=>t==="funnel"?{prefix:"cx2",namespace:"http://schemas.microsoft.com/office/drawing/2015/10/21/chartex"}:CHARTEX_REQUIRES,CHARTEX_REL="http://schemas.microsoft.com/office/2014/relationships/chartEx",CHARTEX_TYPE="application/vnd.ms-office.chartex+xml",CHARTEX_URI=_,chartExReference=t=>`<cx:chart xmlns:cx="${_}" xmlns:r="${P}" r:id="${c(t)}"/>`;const W={"&":"&","<":"<",">":">",'"':"""},z=t=>{const n=t.charCodeAt(0);return n<32&&n!==9&&n!==10&&n!==13||n===65534||n===65535},c=t=>Array.from(t,n=>z(n)?"":W[n]??n).join("");function e(t,n={},...r){const a=Object.entries(n).filter(([,i])=>i!==void 0).map(([i,s])=>` ${i}="${c(typeof s=="boolean"?s?"1":"0":String(s))}"`).join(""),o=r.join("");return o===""?`<${t}${a}/>`:`<${t}${a}>${o}</${t}>`}const m=t=>t===null?e("a:noFill"):e("a:solidFill",{},C(t)),x=(t,n)=>e("a:ln",n===void 0?{}:{w:Math.round(n*12700)},m(t)),L=(t,n,r)=>e("cx:txPr",{},e("a:bodyPr"),e("a:lstStyle"),e("a:p",{},e("a:pPr",{},e("a:defRPr",{...t===void 0?{}:{sz:Math.round(t*100)},...r===void 0?{}:{b:r?1:0}},n===void 0?"":m(n))),e("a:endParaRPr",{lang:"en-US"}))),v=t=>`{00000000-0000-4000-8000-${String(t+1).padStart(12,"0")}}`,G=(t,n,r)=>e("cx:strDim",{type:"cat"},t===void 0?"":`<cx:f>${c(t)}</cx:f>`,...(r===void 0?[n]:Array.from({length:r[0]?.length??0},(a,o)=>r.map(i=>i[o]??"")).reverse()).map(a=>e("cx:lvl",{ptCount:a.length},...a.map((o,i)=>e("cx:pt",{idx:i},c(o)))))),Y=(t,n,r,a)=>e("cx:numDim",{type:t},`<cx:f>${c(n)}</cx:f>`,e("cx:lvl",{ptCount:a.length,formatCode:r??"General"},...a.flatMap((o,i)=>o===null?[]:[e("cx:pt",{idx:i},String(o))])));function q(t,n){if(!n)return"";const r=t.type==="waterfall"?n.position??"outEnd":t.type==="treemap"||t.type==="sunburst"||t.type==="funnel"?n.position??"ctr":n.position??$({type:"column-clustered",labels:n});return e("cx:dataLabels",{pos:r},n.number_format===void 0?"":e("cx:numFmt",{formatCode:n.number_format,sourceLinked:0}),n.size===void 0&&n.color===void 0&&n.bold===void 0?"":L(n.size,n.color,n.bold),e("cx:visibility",{seriesName:n.show_series_name===!0,categoryName:n.show_category_name===!0,value:n.show_value??!0}),...n.points===void 0?[]:t.categories.flatMap((a,o)=>n.points?.includes(o)===!0?[]:[e("cx:dataLabelHidden",{idx:o})]))}const B=t=>e("cx:binning",{intervalClosed:t.interval_closed==="left"?"l":"r",underflow:t.underflow,overflow:t.overflow},t.bin_width!==void 0?e("cx:binSize",{val:t.bin_width}):t.bin_count!==void 0?e("cx:binCount",{val:t.bin_count}):"");function K(t){return t.type==="treemap"?e("cx:layoutPr",{},e("cx:parentLabelLayout",{val:t.parent_labels??"banner"})):t.type==="sunburst"||t.type==="funnel"?"":t.type==="histogram"||t.type==="pareto"?e("cx:layoutPr",{},p(t)?B(t):e("cx:aggregation")):t.type==="waterfall"?e("cx:layoutPr",{},e("cx:visibility",{connectorLines:t.connector_lines!==!1}),e("cx:subtotals",{},...(t.totals??[]).map(n=>e("cx:idx",{val:n})))):e("cx:layoutPr",{},e("cx:visibility",{meanLine:t.show_mean_line===!0,meanMarker:t.show_mean_markers!==!1,nonoutliers:t.show_inner_points===!0,outliers:t.show_outliers!==!1}),e("cx:statistics",{quartileMethod:t.quartile_method??"exclusive"}))}function w(t,n,r){const a=t.series[n];if(!a)return"";const o=a.color??T(n),i=r.name(n),s=t.type==="box-whisker"?e("cx:spPr",{},m(h(o,a.transparency??y.fillTransparency)),x(o,y.lineWidth)):t.type==="histogram"||t.type==="pareto"?e("cx:spPr",{},m(h(o,a.transparency)),p(t)?x("lt1",O):""):"",d=(a.point_colors??[]).flatMap((l,S)=>l==null?[]:[e("cx:dataPt",{idx:S},e("cx:spPr",{},m(h(l,a.transparency))))]),f=a.labels===void 0?t.labels:a.labels;return e("cx:series",{layoutId:j[t.type],uniqueId:v(n),formatIdx:n},e("cx:tx",{},e("cx:txData",{},i===void 0?"":`<cx:f>${c(i)}</cx:f>`,`<cx:v>${c(a.name)}</cx:v>`)),s,...d,q(t,f),e("cx:dataId",{val:n}),K(t),t.type==="pareto"?e("cx:axisId",{val:1}):"")}const Q=t=>e("cx:series",{layoutId:"paretoLine",ownerIdx:0,uniqueId:v(t.series.length)},e("cx:spPr",{},x(M,u.lineWidth)),e("cx:axisId",{val:2})),A=(t,n)=>e("cx:rich",{},e("a:bodyPr"),e("a:lstStyle"),...t.split(`
|
|
4
|
+
`).map(r=>e("a:p",{},e("a:pPr",{},e("a:defRPr",{sz:n,b:0})),e("a:r",{},e("a:rPr",{lang:"en-US",sz:n,b:0}),`<a:t>${c(r)}</a:t>`)))),E=(t,n)=>t===void 0||t===""?"":e("cx:title",{},e("cx:tx",{},A(t,n)));function J(t,n,r){const a=t.category_axis??{},o=t.value_axis??{},i=t.gap_width!==void 0?t.gap_width/100:t.type==="waterfall"?N:t.type==="box-whisker"?y.gap:t.type==="pareto"&&!p(t)?F:t.type==="funnel"?D:0,s=d=>d.visible!==!1&&d.tick_label_position!=="none";return t.type==="treemap"||t.type==="sunburst"?"":t.type==="funnel"?e("cx:axis",{id:0,...a.visible===!1?{hidden:!0}:{}},e("cx:catScaling",{gapWidth:Number(i.toFixed(4))}),s(a)?e("cx:tickLabels"):""):e("cx:axis",{id:0,...a.visible===!1?{hidden:!0}:{}},e("cx:catScaling",{gapWidth:Number(i.toFixed(4))}),E(a.title,n),s(a)&&(r||p(t))?e("cx:tickLabels"):"",e("cx:spPr",{},x(a.line_color??X,u.gridWidth)))+e("cx:axis",{id:1,...o.visible===!1?{hidden:!0}:{}},e("cx:valScaling",{max:o.maximum_scale,min:o.minimum_scale,majorUnit:o.major_unit}),E(o.title,n),o.has_major_gridlines===!1?"":e("cx:majorGridlines",{},e("cx:spPr",{},x(o.gridline_color??k,u.gridWidth))),s(o)?e("cx:tickLabels"):"",o.number_format===void 0?"":e("cx:numFmt",{formatCode:o.number_format,sourceLinked:0}),e("cx:spPr",{},x(null)))+(t.type==="pareto"?e("cx:axis",{id:2},e("cx:valScaling",{max:1,min:0}),e("cx:units",{unit:"percentage"}),e("cx:tickLabels"),e("cx:spPr",{},x(null))):"")}const V={bottom:"b",top:"t",left:"l",right:"r"},Z=e("cx:spPr",{},e("a:noFill"),e("a:ln",{},e("a:noFill")));export function chartExXml(t,n){const r=U(t),a=r.font_size??u.fontSize,o=Math.round((r.title_size??a*u.titleScale)*100),i=r.categories.length>0&&n.refs.categories!==void 0,s=r.series.map((f,l)=>e("cx:data",{id:l},i?G(n.refs.categories,r.categories,r.category_levels):"",Y(H(r.type)?"size":"val",n.refs.values(l),f.number_format,f.values))),d=r.title!==void 0&&r.title!==""?r.title:void 0;return b+e("cx:chartSpace",{"xmlns:a":g,"xmlns:r":P,"xmlns:cx":_},e("cx:chartData",{},n.workbook===void 0?"":e("cx:externalData",{"r:id":n.workbook,"cx:autoUpdate":!1}),...s),e("cx:chart",{},d===void 0?"":e("cx:title",{pos:"t",align:"ctr",overlay:!1},e("cx:tx",{},A(d,o))),e("cx:plotArea",{},e("cx:plotAreaRegion",{},...r.type==="histogram"||r.type==="pareto"?[w(r,0,n.refs)]:r.series.map((f,l)=>w(r,l,n.refs)),r.type==="pareto"?Q(r):""),J(r,Math.round(a*100),i)),r.legend===void 0?"":e("cx:legend",{pos:V[r.legend],align:"ctr",overlay:r.legend_overlay===!0})),n.frameless===!0?Z:"",L(a,r.font_color??I))}const R="http://schemas.microsoft.com/office/drawing/2012/chartStyle";export const CHARTEX_STYLE_REL="http://schemas.microsoft.com/office/2011/relationships/chartStyle",CHARTEX_COLORS_REL="http://schemas.microsoft.com/office/2011/relationships/chartColorStyle",CHARTEX_STYLE_TYPE="application/vnd.ms-office.chartstyle+xml",CHARTEX_COLORS_TYPE="application/vnd.ms-office.chartcolorstyle+xml";const ee={waterfall:395,"box-whisker":406,histogram:366,pareto:366,treemap:381,sunburst:381,funnel:419},te=["axisTitle","categoryAxis","chartArea","dataLabel","dataPoint","dataPoint3D","dataPointLine","dataPointMarker","dataPointMarkerLayout","dataPointWireframe","dataTable","downBar","dropLine","errorBar","floor","gridlineMajor","gridlineMinor","hiLoLine","leaderLine","legend","plotArea","plotArea3D","seriesAxis","seriesLine","title","trendline","trendlineLabel","upBar","valueAxis","wall"];export function chartExStyleXml(t){const n=(a="")=>e("cs:lnRef",{idx:0})+e("cs:fillRef",{idx:0},a)+e("cs:effectRef",{idx:0}),r=a=>a==="dataPoint"?e("cs:dataPoint",{},n(e("cs:styleClr",{val:"auto"})),e("cs:fontRef",{idx:"minor"},e("cs:schemeClr",{val:"tx1"})),e("cs:spPr",{},e("a:solidFill",{},e("a:schemeClr",{val:"phClr"})))):a==="chartArea"?e("cs:chartArea",{mods:"allowNoFillOverride allowNoLineOverride"},n(),e("cs:fontRef",{idx:"minor"},e("a:schemeClr",{val:"tx1"}))):e(`cs:${a}`,{},n(),e("cs:fontRef",{idx:"minor"}));return b+e("cs:chartStyle",{"xmlns:cs":R,"xmlns:a":g,id:ee[t]},...te.map(r))}export function chartExColorsXml(){return b+e("cs:colorStyle",{"xmlns:cs":R,"xmlns:a":g,meth:"cycle",id:10},...[1,2,3,4,5,6].map(t=>e("a:schemeClr",{val:`accent${String(t)}`})))}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
+
import{RECIPE_CHART_TYPES as P}from"@allyhub/formats";import{accentOf as R,CHART_AXIS as I,CHART_DEFAULTS as S,CHART_GRID as O,chartDrawing as V,chartScale as H,formatValue as C,scaleShare as G,seeThrough as T,textWidth as Z}from"./chart.js";const f=e=>String(Number(e.toFixed(3))),B=new Set(P);export const isRecipe=e=>B.has(e),isRadar=e=>e.startsWith("radar"),isStock=e=>e.startsWith("stock");export function recipeOrder(e){const t=e.series.length;return e.type!=="bullet"||t<2?Array.from({length:t},(r,o)=>o):[...Array.from({length:t-2},(r,o)=>t-1-o),0,1]}const z=[.32,.2,.11,.06];export function recipeDef(e,t=300){return isAcross(e)?e:e.type==="dumbbell"?{...e,type:"line-markers",high_low_lines:!0,series:e.series.map((r,o)=>({...r,line_width:0,marker_symbol:r.marker_symbol??"circle",marker_size:r.marker_size??9,color:r.color??R(o)}))}:e.type==="slope"?J(e,t):e.type==="bullet"?U(e):e}function J(e,t){const r=e.labels?.size??e.font_size??S.fontSize,o=Math.max(0,e.categories.length-1),c=e.series.flatMap(n=>n.values.filter(a=>a!==null)),x=Math.min(0,...c),b=Math.max(0,...c)-x||1,u=t*.8,h=n=>{const m=[...e.series.map((d,s)=>({i:s,y:u*(1-((d.values[n]??0)-x)/b)}))].sort((d,s)=>d.y-s.y),g=r*1.25,M=new Map;let w=-1/0;for(const d of m){const s=Math.max(d.y,w+g);M.set(d.i,s-d.y),w=s}return M},l=h(0),i=h(o);return{...e,type:"line-markers",category_axis:{tick_label_position:"high",...e.category_axis},value_axis:{visible:!1,has_major_gridlines:!1,...e.value_axis},series:e.series.map((n,a)=>{const m=n.values[0],g=(d,s,p)=>{const y=s.get(a)??0;return{index:d,text:p,position:d===0?"l":"r",...Math.abs(y)>.01?{dy:Number((y/t).toFixed(4))}:{}}},M=n.number_format,w=n.values[o];return{...n,point_labels:[g(0,l,`${n.name} ${m==null?"":C(m,M)}`),g(o,i,w==null?"":C(w,M))]}})}}export const isAcross=e=>(e.type==="bullet"||e.type==="dumbbell")&&e.orientation!=="vertical";const W=60,K=.4;export const ACROSS_TICK=.3,TARGET_WIDTH=2.5,JOIN_WIDTH=2;export function acrossBase(e){const t=e.series.flatMap(n=>n.values.filter(a=>a!==null)),[r,o]=[Math.min(0,...t),Math.max(1,...t)],{major:c}=H(r,o,300,60,e.value_axis),x={min:Math.floor(r/c)*c,max:Math.ceil(o/c)*c},v=(n,a)=>({...n,values:n.values.map(()=>null),color:n.color??a}),[b,u,...h]=e.series,l=e.type==="bullet"?[...N(h),...b?[v(b,R(0))]:[],...u?[v(u,"tx1")]:[]]:e.series.map((n,a)=>v(n,R(a))),i={...e};return delete i.orientation,delete i.high_low_lines,{...i,type:"bar-clustered",overlap:100,gap_width:e.gap_width??W,category_axis:{...e.category_axis,reverse_order:!0,crosses:"max"},value_axis:{...e.type==="bullet"?{has_major_gridlines:!1}:{},...e.value_axis,...e.value_axis?.minimum_scale!==void 0&&e.value_axis.maximum_scale!==void 0?{}:{major_unit:e.value_axis?.major_unit??c},minimum_scale:e.value_axis?.minimum_scale??x.min,maximum_scale:e.value_axis?.maximum_scale??x.max},series:l}}export const actualThickness=(e,t)=>t/Math.max(1,e.categories.length)/(1+(e.gap_width??W)/100)*K;export function acrossDrawing(e,t,r){const o=acrossBase(e),c=V(o,t,r),x=c.scales?.value;if(!x)return c;const{plot:v}=c,b=v.height/Math.max(1,e.categories.length),u=l=>v.y+(l+.5)*b,h=l=>v.x+G(x,Math.min(x.max,Math.max(x.min,l)))*v.width;if(e.type==="bullet"){const[l,i]=e.series,n=Math.max(0,e.series.length-2),a=actualThickness(o,v.height);return l?.values.forEach((m,g)=>{if(m===null)return;const[M,w]=[h(0),h(m)].sort((d,s)=>d-s);c.boxes.push({x:M,y:u(g)-a/2,width:w-M,height:a,color:T(l.color??R(0),l.transparency),series:n,category:g})}),i?.values.forEach((m,g)=>{m!==null&&c.lines.push({d:`M${f(h(m))} ${f(u(g)-b*ACROSS_TICK)} V${f(u(g)+b*ACROSS_TICK)}`,color:i.color??"tx1",width:TARGET_WIDTH,series:n+1,category:g})}),c}e.categories.forEach((l,i)=>{const n=e.series.flatMap(a=>{const m=a.values[i];return m==null?[]:[m]});n.length<2||c.lines.push({d:`M${f(h(Math.min(...n)))} ${f(u(i))} H${f(h(Math.max(...n)))}`,color:I,width:JOIN_WIDTH,category:i})}),e.series.forEach((l,i)=>{const n=T(l.color??R(i),l.transparency);l.values.forEach((a,m)=>{a!==null&&c.dots.push({x:h(a),y:u(m),r:(l.marker_size??9)/2,color:n})})});for(const l of c.keys)l.marker=!0;return c}function N(e){return[...e].reverse().map((t,r)=>({...t,color:t.color??T("tx1",1-(z[e.length-1-r]??z[3]))}))}function U(e){const[t,r,...o]=e.series,c=e.series.flatMap(b=>b.values.filter(u=>u!==null)),x=H(0,Math.max(1,...c),300,30,e.value_axis),v={minimum_scale:e.value_axis?.minimum_scale??0,maximum_scale:e.value_axis?.maximum_scale??x.max};return{...e,type:"column-clustered",overlap:100,gap_width:e.gap_width??60,secondary_gap_width:e.secondary_gap_width??260,value_axis:{...e.value_axis,...v},secondary_axis:{...v,visible:!1,has_major_gridlines:!1},series:[...N(o),...t?[{...t,secondary:!0,color:t.color??R(0)}]:[],...r?[{...r,type:"line-markers",secondary:!0,line_width:0,marker_symbol:r.marker_symbol??"dash",marker_size:r.marker_size??22,color:r.color??"tx1"}]:[]]}}export function radarDrawing(e,t,r,o,c,x=Z){const v=Math.max(1,e.categories.length),b=Math.max(0,...e.categories.map(s=>x(s,o)))+o,u=Math.max(0,Math.min((r.right-r.left)/2-b,(r.bottom-r.top)/2-o*1.6)),h=(r.left+r.right)/2,l=(r.top+r.bottom)/2;t.plot={x:h-u,y:l-u,width:u*2,height:u*2};const i=e.series.flatMap(s=>s.values.filter(p=>p!==null)),n=e.value_axis??{},a=H(Math.min(0,...i),Math.max(1,...i),u,o*2.4,{...n,minimum_scale:n.minimum_scale??0});t.scales={value:a};const m=s=>s/v*Math.PI*2,g=(s,p)=>{const y=a.max>a.min?(Math.min(a.max,Math.max(a.min,p))-a.min)/(a.max-a.min):0;return[h+u*y*Math.sin(m(s)),l-u*y*Math.cos(m(s))]},M=s=>`${e.categories.map((p,y)=>{const[$,k]=g(y,s);return`${y===0?"M":"L"}${f($)} ${f(k)}`}).join(" ")} Z`,w=n.number_format??e.series[0]?.number_format??"General";for(const s of a.ticks)if((n.has_major_gridlines??!0)&&t.grid.push({d:M(s),color:n.gridline_color??O,width:S.gridWidth}),n.visible!==!1){const[,p]=g(0,s);t.words.push({x:h-o*.3,y:p,text:C(s,w),size:o*.85,anchor:"end",color:c})}e.categories.forEach((s,p)=>{const[y,$]=g(p,a.max);t.axes.push({d:`M${f(h)} ${f(l)} L${f(y)} ${f($)}`,color:O,width:S.gridWidth});const k=Math.sin(m(p)),D=Math.cos(m(p));t.words.push({x:y+k*o*.6,y:$-D*o*(Math.abs(k)<.2?1.4:.8),text:s,size:o,anchor:Math.abs(k)<.2?"middle":k>0?"start":"end",color:c})});const d=e.type==="radar-filled";e.series.forEach((s,p)=>{const y=s.color??R(p),$=e.categories.map((A,j)=>g(j,s.values[j]??0)),k=`${$.map(([A,j],_)=>`${_===0?"M":"L"}${f(A)} ${f(j)}`).join(" ")} Z`;if(d?t.shapes.push({d:k,color:y,width:0,fill:T(y,s.transparency??.5),series:p}):t.lines.push({d:k,color:T(y,s.transparency),width:s.line_width??S.lineWidth,series:p}),s.marker_symbol===void 0?e.type==="radar-markers":s.marker_symbol!=="none")for(const[A,j]of $)t.dots.push({x:A,y:j,r:(s.marker_size??S.marker)/2,color:y})})}export function stockDrawing(e,t,r){const o=e.type==="stock-ohlc",[c,x,v,b]=o?e.series:[void 0,...e.series.slice(0,3)],u=e.series.flatMap(l=>l.values.filter(i=>i!==null)),h=r(u.length>0?Math.min(...u):0,u.length>0?Math.max(...u):1);e.categories.forEach((l,i)=>{const n=h.band(i),a=n.x+n.width/2,m=x?.values[i],g=v?.values[i];typeof m=="number"&&typeof g=="number"&&t.lines.push({d:`M${f(a)} ${f(h.y(m))} V${f(h.y(g))}`,color:I,width:S.gridWidth*1.5,category:i});const M=b?.values[i],w=c?.values[i],d=n.width/2.5;if(o&&typeof w=="number"&&typeof M=="number"){const s=h.y(Math.max(w,M)),p=h.y(Math.min(w,M));t.boxes.push({x:a-d/2,y:s,width:d,height:Math.max(.75,p-s),color:M>=w?"bg1":"tx1",series:0,category:i}),t.lines.push({d:`M${f(a-d/2)} ${f(s)} H${f(a+d/2)} V${f(p)} H${f(a-d/2)} Z`,color:"tx1",width:S.gridWidth,category:i})}else typeof M=="number"&&t.lines.push({d:`M${f(a)} ${f(h.y(M))} H${f(a+d/2)}`,color:b?.color??"tx1",width:S.lineWidth,category:i})})}const F=e=>JSON.stringify(e,(t,r)=>typeof r=="number"?Number(r.toFixed(5)):r),X=(e,t)=>e.color!==void 0&&t!==void 0&&F(T(e.color,e.transparency))===F(t);export function acrossFrom(e,t){const r=t.find(_=>_.kind==="actual"),o=t.find(_=>_.kind==="target"),c=t.filter(_=>_.kind==="dot"),x=r!==void 0;if(!x&&(o!==void 0||c.length===0))return;const v=e.categories.length,b=_=>({name:_.name,values:Array.from({length:v},(E,L)=>_.values[L]??null),..._.color===void 0?{}:{color:_.color},..._.transparency===void 0?{}:{transparency:_.transparency},..._.marker_size===void 0||_.marker_size===9?{}:{marker_size:_.marker_size}}),u=x?[b(r),...o?[b(o)]:[],...[...e.series].reverse()]:c.map(b),h=_=>{const E={..._};return delete E.color,delete E.transparency,E},{gap_width:l,category_axis:i,value_axis:n,...a}=e;delete a.vary_by_categories,delete a.overlap;const m={...a,type:x?"bullet":"dumbbell",series:u.map(h)},g=acrossBase(m),M=recipeOrder(m),w=[];M.forEach((_,E)=>{w[_]=g.series[E]?.color});const{crosses:d,...s}=i??{};delete s.reverse_order;const{minimum_scale:p,maximum_scale:y,major_unit:$,has_major_gridlines:k,...D}=n??{},A=g.value_axis??{},j={...D,...p===void 0||p===A.minimum_scale?{}:{minimum_scale:p},...y===void 0||y===A.maximum_scale?{}:{maximum_scale:y},...$===void 0||$===A.major_unit?{}:{major_unit:$},...k===void 0||k===(A.has_major_gridlines??!0)?{}:{has_major_gridlines:k}};return{...m,series:u.map((_,E)=>X(_,w[E])?h(_):_),...l===void 0||l===W?{}:{gap_width:l},...Object.keys(j).length>0?{value_axis:j}:{},...Object.keys(s).length>0||d!==void 0&&d!=="max"?{category_axis:{...s,...d===void 0||d==="max"?{}:{crosses:d}}}:{}}}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
-
import{strToU8 as
|
|
3
|
-
`,
|
|
2
|
+
import{strToU8 as A,zipSync as I}from"fflate";import{isScatter as T}from"./chart.js";import{chartSpaceXml as R}from"./chart-xml.js";import{chartExXml as M}from"./chartex-xml.js";import{isExtended as j,withTotals as O}from"./extended.js";import{isRecipe as b,recipeDef as C}from"./classic.js";const X=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
3
|
+
`,z={"&":"&","<":"<",">":">",'"':"""},E=t=>t.replace(/[&<>"]/gu,s=>z[s]??s),n=t=>t<26?String.fromCharCode(65+t):n(Math.floor(t/26)-1)+String.fromCharCode(65+t%26);export function embeddedChartXml(t,s,a,m={}){const c=b(t.type)?C(t,s.height):t,l=c.type==="bubble"?3:2,i=c.categories.length,p=o=>n(o+1),d=T(c.type),f=(o,S)=>{const h=String((c.series[o]?.values.length??0)+1);return`Sheet1!$${n(o*l+S)}$2:$${n(o*l+S)}$${h}`};return R(c,{refs:d?{name:o=>`Sheet1!$${n(o*l+1)}$1`,categories:void 0,values:o=>f(o,1),x:o=>f(o,0),...l===3?{sizes:o=>f(o,2)}:{}}:{name:o=>`Sheet1!$${p(o)}$1`,categories:`Sheet1!$A$2:$A$${String(i+1)}`,values:o=>`Sheet1!$${p(o)}$2:$${p(o)}$${String(i+1)}`},frame:s,...m.frameless===!0?{frameless:!0}:{},tail:`<c:externalData r:id="${E(a)}"><c:autoUpdate val="0"/></c:externalData>`})}export function embeddedChartExXml(t,s,a={}){const m=Math.max(t.categories.length,...t.series.map(i=>i.values.length)),c=String(m+1),l=t.category_levels?.[0]?.length??1;return M(t,{refs:{name:i=>`Sheet1!$${n(i+l)}$1`,categories:t.categories.length===0?void 0:`Sheet1!$A$2:$${n(l-1)}$${c}`,values:i=>`Sheet1!$${n(i+l)}$2:$${n(i+l)}$${c}`},workbook:s,...a.frameless===!0?{frameless:!0}:{}})}const D="http://schemas.openxmlformats.org/spreadsheetml/2006/main",v="http://schemas.openxmlformats.org/officeDocument/2006/relationships",F=new Date(1980,0,1);export function chartBook(t){const s=O(b(t.type)?C(t):t),a=s.type==="bubble"?3:2,m=(r,e)=>`<c r="${r}" t="inlineStr"><is><t>${E(e)}</t></is></c>`,c=T(s.type),l=s.category_levels?.[0]?.length??1,i=(c?s.series.flatMap((r,e)=>[m(`${n(e*a)}1`,"X"),m(`${n(e*a+1)}1`,r.name),...a===3?[m(`${n(e*a+2)}1`,"Size")]:[]]):[m("A1",""),...s.series.map((r,e)=>m(`${n(e+l)}1`,r.name))]).join(""),p=(r,e)=>e==null?"":`<c r="${r}"><v>${String(e)}</v></c>`,d=Math.max(0,...s.series.map(r=>r.values.length)),f=Array.from({length:d},(r,e)=>{const $=String(e+2),x=s.series.flatMap((u,g)=>[p(`${n(g*a)}${$}`,u.x?.[e]),p(`${n(g*a+1)}${$}`,u.values[e]),...a===3?[p(`${n(g*a+2)}${$}`,u.sizes?.[e])]:[]]);return`<row r="${$}">${x.join("")}</row>`}),o=Math.max(s.categories.length,j(s.type)?d:0),S=Array.from({length:o},(r,e)=>{const $=s.categories[e],x=String(e+2),u=s.series.map((k,y)=>{const w=k.values[e];return w==null?"":`<c r="${n(y+l)}${x}"><v>${String(w)}</v></c>`}),g=s.category_levels?.[e],_=g?g.map((k,y)=>k===""?"":m(`${n(y)}${x}`,k)).join(""):$===void 0?"":m(`A${x}`,$);return`<row r="${x}">${_}${u.join("")}</row>`}),h=r=>[A(X+r),{mtime:F}];return I({"[Content_Types].xml":h('<Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types"><Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml"/><Default Extension="xml" ContentType="application/xml"/><Override PartName="/xl/workbook.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml"/><Override PartName="/xl/worksheets/sheet1.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml"/></Types>'),"_rels/.rels":h(`<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Id="rId1" Type="${v}/officeDocument" Target="xl/workbook.xml"/></Relationships>`),"xl/workbook.xml":h(`<workbook xmlns="${D}" xmlns:r="${v}"><sheets><sheet name="Sheet1" sheetId="1" r:id="rId1"/></sheets></workbook>`),"xl/_rels/workbook.xml.rels":h(`<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Id="rId1" Type="${v}/worksheet" Target="worksheets/sheet1.xml"/></Relationships>`),"xl/worksheets/sheet1.xml":h(`<worksheet xmlns="${D}"><sheetData><row r="1">${i}</row>${(c?f:S).join("")}</sheetData></worksheet>`)})}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
+
import{EXTENDED_CHART_TYPES as Y}from"@allyhub/formats";import{chartTree as Z,funnelDrawing as k,sunburstDrawing as J,treemapDrawing as Q}from"./tree.js";import{accentOf as G,axisTitleRoom as z,axisTitleWords as tt,CHART_AXIS as j,CHART_DEFAULTS as B,CHART_GRID as et,chartScale as K,formatValue as F,labelsAt as V,scaleShare as nt,seeThrough as X,textWidth as P}from"./chart.js";const ot=new Set(Y);export const isExtended=t=>ot.has(t),needsCategories=t=>t!=="box-whisker"&&t!=="histogram"&&t!=="pareto"&&t!=="bubble"&&!t.startsWith("scatter"),isHierarchical=t=>t==="treemap"||t==="sunburst";export function defaultLabels(t){if(t==="waterfall"||t==="funnel")return{show_value:!0};if(isHierarchical(t))return{show_category_name:!0,show_value:!1}}export const isBinned=t=>t.type==="histogram"||t.type==="pareto"&&t.categories.length===0;const h=t=>String(Number(t.toFixed(3)));export function quartile(t,e,o="exclusive"){const n=t.length;if(n===0)return Number.NaN;const f=o==="exclusive"?e*(n+1):1+e*(n-1);if(f<=1)return t[0]??Number.NaN;if(f>=n)return t[n-1]??Number.NaN;const s=Math.floor(f),i=t[s-1]??0,d=t[s]??i;return i+(f-s)*(d-i)}export function boxStats(t,e="exclusive"){const o=t.filter(a=>typeof a=="number"&&Number.isFinite(a)).sort((a,y)=>a-y);if(o.length===0)return;const n=quartile(o,.25,e),f=quartile(o,.5,e),s=quartile(o,.75,e),i=(s-n)*1.5,d=o.filter(a=>a>=n-i&&a<=s+i);return{q1:n,median:f,q3:s,mean:o.reduce((a,y)=>a+y,0)/o.length,low:d[0]??n,high:d.at(-1)??s,outliers:o.filter(a=>a<n-i||a>s+i),inner:d,count:o.length}}export function boxGroups(t){const e=t.categories.length>0,o=e?[...new Set(t.categories)]:[""],n=o.map(f=>t.series.map(s=>s.values.filter((i,d)=>!e||t.categories[d]===f)));return{names:o,values:n}}export function waterfallSteps(t,e=[]){let o=0;return t.map((n,f)=>{if(e.includes(f))return o=n??o,{from:0,to:o,kind:"total"};const s=o;return o+=n??0,{from:s,to:o,kind:(n??0)<0?"decrease":"increase"}})}export function withTotals(t){const e=t.series[0];if(t.type!=="waterfall"||!e||(t.totals??[]).length===0)return t;const o=waterfallSteps(e.values,t.totals),n=e.values.map((f,s)=>f===null&&t.totals?.includes(s)===!0?o[s]?.to??null:f);return{...t,series:[{...e,values:n},...t.series.slice(1)]}}const C=(t,e,o)=>e===void 0||e==="General"?String(Number(t.toFixed(Math.min(6,Math.max(0,1-Math.floor(Math.log10(o||1))))))):F(t,e);export function histogramBins(t,e={},o){const n=t.filter(r=>typeof r=="number"&&Number.isFinite(r));if(n.length===0)return[];const f=Math.min(...n),s=Math.max(...n),i=e.underflow!==void 0&&e.overflow!==void 0&&e.underflow>=e.overflow,d=i?void 0:e.underflow,a=i?void 0:e.overflow;let y=d??f,l=a??s;y>=l&&(y=f,l=s);let x,w;if(n.length<2||y===l)x=1,w=Math.max(1,l-y);else if(e.bin_width!==void 0)w=e.bin_width,x=Math.max(1,Math.ceil((l-y)/w-1e-9));else if(e.bin_count!==void 0)x=e.bin_count,w=(l-y)/x;else{const r=n.reduce((g,_)=>g+_,0)/n.length;w=3.5*Math.sqrt(n.reduce((g,_)=>g+(_-r)**2,0)/(n.length-1))/Math.cbrt(n.length),x=w>0?Math.max(1,Math.ceil((l-y)/w-1e-9)):1,w>0||(w=(l-y)/x)}x=Math.min(x,1e3);const S=e.interval_closed==="left",u=[];d!==void 0&&u.push({from:d,to:d,count:n.filter(r=>r<=d).length,label:`≤${C(d,o,w)}`});for(let r=0;r<x;r++){const m=y+r*w,g=r===x-1?a??Math.max(l,m+w):m+w,_=r===0&&d===void 0,c=r===x-1&&a===void 0,E=$=>S?($>=m||_&&$>=y)&&($<g||c&&$<=g):($>m||_&&$>=m)&&$<=g,T=n.filter($=>E($)&&!(d!==void 0&&$<=d)&&!(a!==void 0&&$>a)),v=S?`[${C(m,o,w)}, ${C(g,o,w)}${c?"]":")"}`:`${_?"[":"("}${C(m,o,w)}, ${C(g,o,w)}]`;u.push({from:m,to:g,count:T.length,label:v})}return a!==void 0&&u.push({from:a,to:a,count:n.filter(r=>r>a).length,label:`>${C(a,o,w)}`}),u}export function paretoBars(t){const e=t.series[0];let o;if(isBinned(t))o=histogramBins(e?.values??[],t,e?.number_format).map(s=>[s.label,s.count]);else{const s=new Map;t.categories.forEach((i,d)=>{const a=e?.values[d];typeof a=="number"&&s.set(i,(s.get(i)??0)+a)}),o=[...s]}o.sort((s,i)=>i[1]-s[1]);const n=o.reduce((s,[,i])=>s+i,0);let f=0;return{names:o.map(([s])=>s),values:o.map(([,s])=>s),cumulative:o.map(([,s])=>(f+=s,n>0?f/n:0))}}export const WATERFALL_COLORS={increase:"accent1",decrease:"accent2",total:"accent3"};const st={increase:"Increase",decrease:"Decrease",total:"Total"};export function extendedLegend(t){if(t.type==="treemap"||t.type==="sunburst")return Z(t).children.map(e=>({name:e.name,color:t.category_colors?.[e.branch]??G(e.branch)}));if(t.type==="waterfall"){const e=["increase","decrease"];return(t.totals??[]).length>0&&e.push("total"),e.map(o=>({name:st[o],color:WATERFALL_COLORS[o]}))}if(t.type==="pareto"){const e=t.series[0];return[{name:e?.name??"",color:e?.color??G(0)},{name:"Pareto",color:PARETO_LINE}]}return t.series.slice(0,t.type==="histogram"?1:void 0).map((e,o)=>({name:e.name,color:e.color??G(o)}))}export const PARETO_LINE="accent2",HISTOGRAM_EDGE=.75,BOX_LOOK={fillTransparency:.6,lineWidth:1.5,point:2.5,gap:1},WATERFALL_GAP=.5,categoryFrame=(...t)=>I(...t);function I(t,e,o,n,f,s,i,d,a=P){const y=B,l=t.value_axis??{},x=t.category_axis??{},w=z(o,x.title,l.title,n),S=l.number_format??t.series[0]?.number_format??"General",u=n*.5,r=l.visible!==!1&&l.tick_label_position!=="none",m=d.some(p=>p!=="")&&x.visible!==!1&&x.tick_label_position!=="none",g=Math.max(1,d.length),_=(o.right-o.left-n*3)/g,c=(p,A)=>{const H=[];for(const N of p.split(" ")){const D=H.at(-1);D!==void 0&&a(`${D} ${N}`,n)<=A?H[H.length-1]=`${D} ${N}`:H.push(N)}return H},E=d.map(p=>c(p,_-n*.4)),v=E.every(p=>p.length<=3&&p.every(A=>a(A,n)<=_))?E:d.map(p=>[p]),$=Math.max(1,...v.map(p=>p.length)),b=m?n*1.2*$+u:0,R=K(s,i,o.bottom-o.top-b,n*2.4,l),W=r?Math.max(0,...R.ticks.map(p=>a(F(p,S),n)))+u:0,M={x:o.left+W,y:o.top,width:Math.max(0,o.right-o.left-W),height:Math.max(0,o.bottom-o.top-b)};e.plot=M,tt(e,M,w,x.title,l.title,n,f);const L=K(s,i,M.height,n*2.4,l);e.scales={value:L};const q=p=>M.y+M.height-nt(L,p)*M.height;for(const p of L.ticks)(l.has_major_gridlines??!0)&&e.grid.push({d:`M${h(M.x)} ${h(q(p))} H${h(M.x+M.width)}`,color:l.gridline_color??et,width:y.gridWidth}),r&&e.words.push({x:M.x-u,y:q(p),text:F(p,S),size:n,anchor:"end",color:f});const O=M.width/g;if(x.visible!==!1){const p=q(Math.max(L.min,Math.min(L.max,0)));e.axes.push({d:`M${h(M.x)} ${h(p)} H${h(M.x+M.width)}`,color:x.line_color??j,width:y.gridWidth})}if(m){const p=Math.max(0,...v.flatMap(H=>H.map(N=>a(N,n))))+n*.4,A=x.label_interval??Math.max(1,Math.ceil(p/O));v.forEach((H,N)=>{N%A===0&&H.forEach((D,U)=>{e.words.push({x:M.x+(N+.5)*O,y:M.y+M.height+u+n*(.6+U*1.2),text:D,size:n,anchor:"middle",color:f})})})}return{plot:M,scale:L,y:q,band:p=>({x:M.x+p*O,width:O})}}export function extendedDrawing(t,e,o,n,f,s=P){t.type==="waterfall"?at(t,e,o,n,f,s):t.type==="box-whisker"?it(t,e,o,n,f,s):t.type==="treemap"?Q(t,e,o,n,s):t.type==="sunburst"?J(t,e,o,n,s):t.type==="funnel"?k(t,e,o,n,f,s):rt(t,e,o,n,f,s)}function rt(t,e,o,n,f,s=P){const i=t.series[0],d=t.type==="pareto"?paretoBars(t):void 0,a=d?void 0:histogramBins(i?.values??[],t,i?.number_format),y=d?.names??a?.map(c=>c.label)??[],l=d?.values??a?.map(c=>c.count)??[],x=n*.5,w=d?s("100%",n)+x:0,S=I({...t,...a?{series:[{name:"",values:[]}]}:{}},e,{...o,right:o.right-w},n,f,0,Math.max(1,...l),y,s),u=t.gap_width!==void 0?t.gap_width/100:d&&!isBinned(t)?PARETO_GAP:0,r=X(i?.color??G(0),i?.transparency),m=i?V(t,i,0):void 0;if(l.forEach((c,E)=>{const T=S.band(E),v=T.width/(1+u),$=T.x+(T.width-v)/2,b=S.y(c),R=u===0?HISTOGRAM_EDGE/2:0;e.boxes.push({x:$+R,y:b,width:Math.max(.5,v-R*2),height:Math.max(0,S.y(0)-b),color:i?.point_colors?.[E]??r,series:0,category:E}),m&&e.words.push({x:$+v/2,y:b-(m.size??n)*.8,text:F(c,m.number_format??(a?"General":i?.number_format)),size:m.size??n,anchor:"middle",color:m.color??f})}),!d)return;const{plot:g}=S,_=c=>g.y+g.height*(1-c);for(let c=0;c<=10;c+=2)e.words.push({x:g.x+g.width+x,y:_(c/10),text:`${String(c*10)}%`,size:n,anchor:"start",color:f});e.lines.push({d:d.cumulative.map((c,E)=>{const T=S.band(E);return`${E===0?"M":"L"}${h(T.x+T.width/2)} ${h(_(c))}`}).join(" "),color:PARETO_LINE,width:B.lineWidth,series:1})}export const PARETO_GAP=.5;function at(t,e,o,n,f,s=P){const i=t.series[0],d=t.categories.map((u,r)=>i?.values[r]??null),a=waterfallSteps(d,t.totals),y=a.flatMap(u=>[u.from,u.to]),l=I(t,e,o,n,f,Math.min(0,...y),Math.max(0,...y),t.categories,s),x=t.gap_width===void 0?WATERFALL_GAP:t.gap_width/100,w=t.labels?.size??n,S=u=>u.kind==="total"?u.to:u.to-u.from;a.forEach((u,r)=>{if(d[r]===null&&u.kind!=="total")return;const m=l.band(r),g=m.width/(1+x),_=m.x+(m.width-g)/2,c=l.y(Math.max(u.from,u.to)),E=l.y(Math.min(u.from,u.to));if(e.boxes.push({x:_,y:c,width:g,height:Math.max(.5,E-c),color:X(i?.point_colors?.[r]??WATERFALL_COLORS[u.kind],i?.transparency),series:0,category:r}),a[r+1]&&t.connector_lines!==!1){const $=(u.kind==="total",u.to),b=l.band(r+1),R=b.x+(b.width-b.width/(1+x))/2;e.lines.push({d:`M${h(_+g)} ${h(l.y($))} H${h(R)}`,color:j,width:B.gridWidth})}const v=i?V(t,i,r):void 0;if(v&&i){const $=u.to>=u.from;e.words.push({x:_+g/2,y:$?c-w*.8:E+w*.8,text:F(S(u),v.number_format??i.number_format),size:v.size??w,anchor:"middle",color:v.color??f,...v.bold===!0?{bold:!0}:{}})}})}function it(t,e,o,n,f,s=P){const i=t.quartile_method??"exclusive",d=boxGroups(t),a=d.values.map(r=>r.map(m=>boxStats(m,i))),y=a.flat().flatMap(r=>r?[r.low,r.high,r.q1,r.q3,...t.show_outliers===!1?[]:r.outliers]:[]),l=I(t,e,o,n,f,y.length>0?Math.min(...y):0,y.length>0?Math.max(...y):1,d.names,s),x=Math.max(1,t.series.length),w=t.gap_width===void 0?BOX_LOOK.gap:t.gap_width/100,S=BOX_LOOK.lineWidth,u=t.series.map(()=>[]);a.forEach((r,m)=>{const g=l.band(m),_=g.width/(x+w);r.forEach((c,E)=>{if(!c)return;const T=t.series[E],v=T?.color??G(E),$=g.x+(g.width-_*x)/2+E*_,b=$+_/2,R=_*.1,[W,M]=[$+R,$+_-R],L=l.y(c.q3),q=l.y(c.q1);e.boxes.push({x:W,y:L,width:M-W,height:Math.max(.5,q-L),color:X(v,T?.transparency??BOX_LOOK.fillTransparency),series:E,category:m});const O=(M-W)/4,p=D=>{e.lines.push({d:D,color:v,width:S,series:E,category:m})};p(`M${h(W)} ${h(L)} H${h(M)} V${h(q)} H${h(W)} Z`),p(`M${h(W)} ${h(l.y(c.median))} H${h(M)}`),p(`M${h(b)} ${h(L)} V${h(l.y(c.high))}`),p(`M${h(b)} ${h(q)} V${h(l.y(c.low))}`),p(`M${h(b-O)} ${h(l.y(c.high))} H${h(b+O)}`),p(`M${h(b-O)} ${h(l.y(c.low))} H${h(b+O)}`);const A=BOX_LOOK.point;if(t.show_mean_markers!==!1){const D=l.y(c.mean);p(`M${h(b-A)} ${h(D-A)} L${h(b+A)} ${h(D+A)} M${h(b-A)} ${h(D+A)} L${h(b+A)} ${h(D-A)}`)}u[E]?.push([b,l.y(c.mean)]);const H=[...t.show_outliers===!1?[]:c.outliers,...t.show_inner_points===!0?c.inner:[]];for(const D of H)e.dots.push({x:b,y:l.y(D),r:A,color:v});const N=T?V(t,T,m):void 0;N&&T&&e.words.push({x:M+n*.3,y:l.y(c.median),text:F(c.median,N.number_format??T.number_format),size:N.size??n,anchor:"start",color:N.color??f,...N.bold===!0?{bold:!0}:{}})})}),t.show_mean_line===!0&&u.forEach((r,m)=>{r.length<2||e.lines.push({d:r.map(([g,_],c)=>`${c===0?"M":"L"}${h(g)} ${h(_)}`).join(" "),color:t.series[m]?.color??G(m),width:S,series:m})})}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
-
export*from"./color.js";export*from"./chart.js";export*from"./chart-file.js";export*from"./chart-xml.js";export*from"./embedded.js";export*from"./svg.js";
|
|
2
|
+
export*from"./color.js";export*from"./chart.js";export*from"./extended.js";export*from"./tree.js";export*from"./classic.js";export*from"./chart-file.js";export*from"./chart-xml.js";export*from"./chartex-xml.js";export*from"./embedded.js";export*from"./svg.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
-
import{colorRgb as
|
|
2
|
+
import{colorRgb as w}from"./color.js";import{chartDrawing as p}from"./chart.js";export const OFFICE_COLORS={dk1:"#000000",lt1:"#FFFFFF",dk2:"#44546A",lt2:"#E7E6E6",accent1:"#4472C4",accent2:"#ED7D31",accent3:"#A5A5A5",accent4:"#FFC000",accent5:"#5B9BD5",accent6:"#70AD47",hlink:"#0563C1",folHlink:"#954F72"};const k={"&":"&","<":"<",">":">",'"':"""},i=r=>r.replace(/[&<>"]/gu,o=>k[o]??o),e=r=>String(Number(r.toFixed(3)));function F(r,o){const c=t=>{const l=t.fill===void 0?"none":o(t.fill),$=t.width>0?o(t.color):"none",s=t.dash===void 0?"":` stroke-dasharray="${i(t.dash)}"`;return`<path d="${i(t.d)}" fill="${l}" stroke="${$}" stroke-width="${e(t.width)}" stroke-linejoin="round"${s}/>`},n=[];for(const t of[...r.grid,...r.shapes])n.push(c(t));for(const t of[...r.boxes,...r.keys])n.push(t.line!==void 0||t.marker===!0?`${t.line===void 0?"":`<path d="M${e(t.x)} ${e(t.y+t.height/2)} H${e(t.x+t.width)}" fill="none" stroke="${o(t.color)}" stroke-width="${e(t.line.width)}"${t.line.dash===void 0?"":` stroke-dasharray="${i(t.line.dash)}"`}/>`}${t.marker===!0?`<circle cx="${e(t.x+t.width/2)}" cy="${e(t.y+t.height/2)}" r="${e(Math.min(t.height/2,3))}" fill="${o(t.color)}"/>`:""}`:t.hollow===!0?`<rect x="${e(t.x)}" y="${e(t.y)}" width="${e(t.width)}" height="${e(t.height)}" fill="none" stroke="${o(t.color)}" stroke-width="1.5"/>`:`<rect x="${e(t.x)}" y="${e(t.y)}" width="${e(t.width)}" height="${e(t.height)}" fill="${o(t.color)}"/>`);for(const t of[...r.axes,...r.lines])n.push(c(t));for(const t of r.dots)n.push(t.d===void 0?`<circle cx="${e(t.x)}" cy="${e(t.y)}" r="${e(t.r)}" fill="${o(t.color)}"/>`:`<path d="${i(t.d)}" fill="${o(t.color)}"/>`);for(const t of r.words){const l=t.rotate===void 0?"":` transform="rotate(${e(t.rotate)} ${e(t.x)} ${e(t.y)})"`;n.push(`<text x="${e(t.x)}" y="${e(t.y)}" font-size="${e(t.size)}" text-anchor="${t.anchor}" dominant-baseline="central" fill="${o(t.color)}"${l}>${i(t.text)}</text>`)}return n.join("")}export function chartSvg(r,o,c,n={}){const t=n.pointsPerPixel??.75,l=o*t,$=c*t,s=n.colors??OFFICE_COLORS,d=g=>w(g,s),f=n.font??"Carlito, Calibri, Arial, sans-serif",h=n.paper??"#FFFFFF",a=n.edge??"#D9D9D9",u=n.label===void 0?"":` role="img" aria-label="${i(n.label)}"`,x=h==="none"&&a==="none"?"":`<rect x="0.375" y="0.375" width="${e(l-.75)}" height="${e($-.75)}" fill="${i(h)}" stroke="${i(a)}" stroke-width="${a==="none"?"0":"0.75"}"/>`;return`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${e(l)} ${e($)}" width="${e(o)}" height="${e(c)}" font-family="${i(f)}"${u}>${x}${F(p(r,l,$,n.measure),d)}</svg>`}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
+
import{accentOf as A,formatValue as k,textWidth as D}from"./chart.js";const z=t=>String(Number(t.toFixed(3)));export function chartTree(t){const s={name:"",value:0,children:[],depth:0,branch:0},e=t.series[0]?.values??[];return t.categories.forEach((y,r)=>{const p=e[r];if(typeof p!="number"||!(p>0))return;const l=(t.category_levels?.[r]??[y]).filter(i=>i!=="");let c=s;s.value+=p,l.forEach((i,d)=>{let f=c.children.find(g=>g.name===i);f||(f={name:i,value:0,children:[],depth:d+1,branch:d===0?s.children.length:c.branch},c.children.push(f)),f.value+=p,d===l.length-1&&(f.point=r),c=f})}),s}const q=t=>[...t].sort((s,e)=>e.value-s.value);function V(t,s){const e=new Map,y=(1+Math.sqrt(5))/2;let{x0:r,y0:p}=s;const{x1:l,y1:c}=s;let i=t.reduce((g,x)=>g+x.value,0),d=0;const f=t.length;for(;d<f;){const g=l-r,x=c-p;let a=d,n=t[a++]?.value??0,h=n,o=n;const w=Math.max(x/g,g/x)/(i*y);let b=n*n*w,v=Math.max(o/b,b/h);for(;a<f;a++){const u=t[a]?.value??0;n+=u,h=Math.min(h,u),o=Math.max(o,u),b=n*n*w;const M=Math.max(o/b,b/h);if(M>v){n-=u;break}v=M}const m=t.slice(d,a);if(g<x){const u=i>0?p+x*n/i:c;let M=r;for(const $ of m){const _=n>0?g*$.value/n:0;e.set($,{x0:M,y0:p,x1:M+_,y1:u}),M+=_}p=u}else{const u=i>0?r+g*n/i:l;let M=p;for(const $ of m){const _=n>0?x*$.value/n:0;e.set($,{x0:r,y0:M,x1:u,y1:M+_}),M+=_}r=u}i-=n,d=a}return e}function F(t,s){const e=t.labels,y=t.series[0],r=[];return e&&(e.show_category_name===!0&&r.push(s.name),e.show_value===!0&&r.push(k(s.value,e.number_format??y?.number_format))),r}export function treemapDrawing(t,s,e,y,r=D){const p=chartTree(t),l={x:e.left,y:e.top,width:e.right-e.left,height:e.bottom-e.top};s.plot=l;const c=t.labels?.size??y,i=(t.parent_labels??"banner")==="banner",d=c*1.6,f=a=>(a.point!==void 0?t.series[0]?.point_colors?.[a.point]:void 0)??t.category_colors?.[a.branch]??A(a.branch),g=(a,n,h=!1)=>{const o=n.x1-n.x0-c*.8;n.y1-n.y0<c*1.4*a.length||a.forEach((w,b)=>{r(w,c)>o||s.words.push({x:n.x0+c*.4,y:n.y0+c*(.9+b*1.2),text:w,size:c,anchor:"start",color:t.labels?.color??"lt1",...h?{bold:!0}:{}})})},x=(a,n)=>{for(const[h,o]of V(q(a),n)){if(h.children.length===0){s.boxes.push({x:o.x0,y:o.y0,width:o.x1-o.x0,height:o.y1-o.y0,color:f(h),series:0,category:h.point??0}),s.lines.push({d:`M${z(o.x0)} ${z(o.y0)} H${z(o.x1)} V${z(o.y1)} H${z(o.x0)} Z`,color:"lt1",width:1}),g(F(t,h),o);continue}const w=h.depth===1&&i;w&&(s.boxes.push({x:o.x0,y:o.y0,width:o.x1-o.x0,height:Math.min(d,o.y1-o.y0),color:f(h),series:0,category:0}),g([h.name],{...o,y1:o.y0+d},!0)),x(h.children,{...o,y0:w?Math.min(o.y1,o.y0+d):o.y0}),h.depth===1&&t.parent_labels==="overlapping"&&g([h.name],o,!0)}};x(p.children,{x0:l.x,y0:l.y,x1:l.x+l.width,y1:l.y+l.height})}function W(t,s,e,y,r,p){const l=(d,f)=>`${z(t+d*Math.sin(f))} ${z(s-d*Math.cos(f))}`,c=p-r>=Math.PI*2?r+Math.PI*2-1e-4:p,i=c-r>Math.PI?1:0;return`M${l(y,r)} A${z(y)} ${z(y)} 0 ${String(i)} 1 ${l(y,c)} L${l(e,c)} A${z(e)} ${z(e)} 0 ${String(i)} 0 ${l(e,r)} Z`}export function sunburstDrawing(t,s,e,y,r=D){const p=chartTree(t),l=h=>h.children.length===0?h.depth:Math.max(...h.children.map(l)),c=Math.max(1,l(p)),i=Math.max(0,Math.min(e.right-e.left,e.bottom-e.top)/2),d=(e.left+e.right)/2,f=(e.top+e.bottom)/2;s.plot={x:d-i,y:f-i,width:i*2,height:i*2};const g=i/(c*2+1),x=(i-g)/c,a=t.labels?.size??y,n=(h,o,w)=>{const b=h.reduce((m,u)=>m+u.value,0);let v=o;for(const m of q(h)){const u=v+(b>0?(w-o)*m.value/b:0),M=g+x*(m.depth-1),$=M+x;s.shapes.push({d:W(d,f,M,$,v,u),color:"lt1",width:1,fill:(m.point!==void 0?t.series[0]?.point_colors?.[m.point]:void 0)??t.category_colors?.[m.branch]??A(m.branch),series:0,category:m.point??0});const _=(v+u)/2,E=(M+$)/2,S=F(t,m),N=(u-v)*E,O=(P,I)=>1/Math.hypot(Math.sin(_)/P,Math.cos(_)/I),H=O(x*.9,N*.9),L=O(N*.9,x*.9);S.every(P=>r(P,a)<H)&&L>a*1.2*S.length&&S.forEach((P,I)=>{s.words.push({x:d+E*Math.sin(_),y:f-E*Math.cos(_)+a*1.2*(I-(S.length-1)/2),text:P,size:a,anchor:"middle",color:t.labels?.color??"lt1"})}),n(m.children,v,u),v=u}};n(p.children,0,Math.PI*2)}export const FUNNEL_GAP=.06;export function funnelDrawing(t,s,e,y,r,p=D){const l=t.series[0],c=t.categories.map((v,m)=>Math.max(0,l?.values[m]??0)),i=Math.max(0,...c),d=y*.5,f=t.category_axis??{},g=f.visible!==!1&&f.tick_label_position!=="none",x=g?Math.max(0,...t.categories.map(v=>p(v,y)))+d:0,a={x:e.left+x,y:e.top,width:Math.max(0,e.right-e.left-x),height:Math.max(0,e.bottom-e.top)};s.plot=a;const n=a.height/Math.max(1,c.length),h=t.gap_width===void 0?FUNNEL_GAP:t.gap_width/100,o=n/(1+h),w=t.labels,b=w?.size??y;c.forEach((v,m)=>{const u=i>0?a.width*v/i:0,M=a.x+(a.width-u)/2,$=a.y+m*n+(n-o)/2;if(s.boxes.push({x:M,y:$,width:u,height:o,color:l?.point_colors?.[m]??l?.color??A(0),series:0,category:m}),g&&s.words.push({x:a.x-d,y:$+o/2,text:t.categories[m]??"",size:y,anchor:"end",color:r}),w&&w.show_value!==!1){const _=k(v,w.number_format??l?.number_format),E=p(_,b)<u-b;s.words.push({x:E?M+u/2:M+u+b*.4,y:$+o/2,text:_,size:b,anchor:E?"middle":"start",color:w.color??(E?"lt1":r),...w.bold===!0?{bold:!0}:{}})}})}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
2
|
import{itemFiles as Me,kindsUsed as Ce,listsFile as Le,within as Pe}from"@allyhub/formats";import{createHash as ae}from"node:crypto";import{uniformInt as de}from"pure-rand/distribution/uniformInt";import{xoroshiro128plus as Ie}from"pure-rand/generator/xoroshiro128plus";import{fileProblems as ve,listedFileProblems as De,inTime as fe,itemKindBuild as N}from"@allyhub/build";import{readPng as ue}from"@allyhub/measure";import{countLevels as Ee,problem as me}from"@allyhub/diagnostics";import{comboIdOf as j,comboKey as le,comboMatches as Fe,coverCombos as Oe,pieceNamed as B,CONSOLE_LIMIT as Ke}from"@allyhub/piece";import{OutputCache as _e,cacheKey as Ae,checkerId as Te}from"./cache.js";import{consoleOf as Ne,baseDigest as je,outputDigest as pe,dedupe as he,StuckError as we,CheckSession as Be,runtimeDigest as He,extraCombos as Re,measureParts as ze,kindsNeeded as Ue}from"@allyhub/project";export function checkStats(e,i,n,t=0){const o=i.length;return{loaded:i,reused:n,outputs:{total:e,checked:o,reused:Math.max(0,e-o-t),covered:t}}}export const plural=(e,i)=>`${String(e)} ${i}${e===1?"":"s"}`;const be=e=>Ie(ae("sha256").update(e).digest().readInt32BE(0));export function samplesFor(e,i,n,t){const o=new Set(e.slice(0,t)),r=be(n),c=Math.floor(i*30);for(let a=0;o.size<Math.min(t,c)&&a<t*20;a++)o.add(de(r,0,c-1)/30);return[...o]}export function shuffled(e,i){const n=[...e],t=be(i);for(let o=n.length-1;o>0;o--){const r=de(t,0,o),c=n[o],a=n[r];c===void 0||a===void 0||(n[o]=a,n[r]=c)}return n}export const RASTER_NOISE=3,RASTER_SPECKS=8;export function frameDifference(e,i){const n=ue(e),t=ue(i);if(n.width!==t.width||n.height!==t.height)return{max:255,pixels:Math.max(n.width*n.height,1)};let o=0,r=0;for(let c=0;c<n.data.length;c+=4){let a=0;for(let p=0;p<4;p++)a=Math.max(a,Math.abs((n.data[c+p]??0)-(t.data[c+p]??0)));a>RASTER_NOISE&&r++,a>o&&(o=a)}return{max:o,pixels:r}}const ge=e=>ae("sha256").update(e).digest("hex");export async function determinism(e,i,n){const t=e.timeline,o=samplesFor(t.parts.map(d=>d.still),t.duration,i,n),r=new Map;for(const d of[...o].sort((u,k)=>u-k))r.set(d,await e.shot(d));const c=[];let a=0;for(const d of shuffled(o,`${i}:shuffle`)){const u=r.get(d),k=await e.shot(d);if(!u||ge(k)===ge(u))continue;const S=frameDifference(u,k);S.pixels>RASTER_SPECKS&&(c.push(d),a=Math.max(a,S.max))}if(c.length===0)return[];c.sort((d,u)=>d-u);const p=[...new Set(c.flatMap(d=>t.parts.filter(u=>d>=u.start&&d<u.end).map(u=>u.key)))];return[me("AK-D002",`${plural(c.length,"moment")} drew differently in order and out of order (${c.map(d=>`${d.toFixed(2)}s`).join(", ")}; pixels differ by up to ${String(a)} levels). render must depend only on t, not on state left by an earlier frame.`,{piece:e.target.piece,output:e.target.output,combo:e.target.combo,format:e.target.format,t:c[0]??0,...p.length===1&&p[0]?{part:p[0]}:{}})]}function Ge(e,i){const n=e.piece===void 0?void 0:i.pieces.find(o=>o.id===e.piece)?.place??e.piece,t=e.where?.file;return i.items.filter(o=>o.id===n||t!==void 0&&Le(Me(o),t))}export function askedProblems(e,i){return e.problems.filter(n=>{if(i===void 0)return!0;const t=Ge(n,e);return t.length===0||t.some(o=>B({id:o.id,path:o.entry},i))})}export function summarize(e){const i=Ee(e);return{status:i.errors>0?"failed":i.warnings>0?"warnings":"passed",...i}}function Ye(e,i){const n=r=>[r.piece??"",r.output??"",r.combo?le(r.combo):"",r.format??"",r.part??"",r.where?.file??"",String(r.where?.line??0).padStart(6,"0"),r.code].join("\0"),t=n(e),o=n(i);return t<o?-1:t>o?1:0}class qe{spent=new Map;on=process.env.ALLYHUB_CHECK_TIMINGS==="1";async time(i,n){if(!this.on)return n();const t=performance.now();try{return await n()}finally{this.spent.set(i,(this.spent.get(i)??0)+(performance.now()-t)/1e3)}}report(){if(!this.on)return;const i=[...this.spent].sort((n,t)=>t[1]-n[1]);process.stderr.write(`Check timings (s): ${i.map(([n,t])=>`${n} ${t.toFixed(2)}`).join(", ")}
|
|
3
|
-
`)}}const Je=(e,i)=>{const n=new Set(Ce(e,i));return e.filter(t=>n.has(t)||t.layers===!0)};async function Qe(e){const i=[],n=new Set;for(const t of e){if(t.layers!==!0)continue;const o=await N(e,{kind:t.id});!o?.layers||n.has(o)||(n.add(o),i.push(o.layers))}return i}export async function runCheck(e){const i=new qe,n=e.session??await i.time("prepare (discover, metadata, bundle)",()=>Be.open({root:e.dir,kinds:Ue(e.kinds),...e.buildDir===void 0?{}:{buildDir:e.buildDir},...e.gpu===void 0?{}:{gpu:e.gpu},...e.consoleLimit===void 0?{}:{consoleLimit:e.consoleLimit}}));try{const t=n.prepared,o=e.samples??12,r=n.consoleLimit,c=await He(),a=await _e.open(t.root,await Te({kinds:Je(t.kinds,t.items),runtimeSha:c,samples:o,gpu:n.gpu,...r===Ke?{}:{consoleLimit:r}})),p=e.facts!==!1,d=await Qe(t.kinds),u=[],k=[...askedProblems(t,e.piece),...e.files===void 0?[]:await ve(t.root,t.files.filter(s=>e.piece===void 0||Pe(s,e.piece.replace(/^\.\//u,"").replace(/\/+$/u,""))),t.items,e.files),...e.files===void 0||e.piece!==void 0?[]:await De(t.root,t.files,t.kinds,e.files)];let S=[];const K=[],H=[],R=[];let z=0,U=0;const G=[],ke=t.pieces.filter(s=>e.piece===void 0||B({id:s.id,path:s.place},e.piece));for(const s of ke){if(!t.bundle?.chunks.entries[s.id.replaceAll("/","__")])continue;const w=s.kind,M=s.format,q=await je(t,s,c),J=async y=>{const $={problems:[],facts:[]},W=new Set,v=[...s.combos.filter(m=>!e.combos?.length||e.combos.some(h=>Fe(m,h,j(s.matrix,m)))),...Re(s,e.combos)],Se=new Set(s.matrix?Oe(s.matrix.space,s.dims,v):v.keys()),X=[],Z=m=>{H.push(m);for(const h of m.reads?.media??[])W.add(h.path);m.timeline&&X.push({...m,timeline:m.timeline})};let T=!1;const $e=(m,h,D)=>{if(e.fresh===!0)return;const f=a.get(m),C=f?.result.reads,E=f?.result.timeline;return!f||!C||!E||D&&!f.sampled||f.factless===!0&&p?void 0:pe(t,q,s,h,C)===f.digest?f:void 0};for(const[m,h]of v.entries()){const D=j(s.matrix,h),f={piece:s.id,output:w,combo:h,format:M},C=le(h);if(K.push({...f,...D?{id:D}:{},key:C}),!Se.has(m)){U++;continue}const E=fe(s,t.kinds)&&!T,F=Ae(s.id,w,C,M),x=$e(F,h,E);if(x){z++,x.sampled&&(T=!0),$.problems.push(...x.problems),$.facts.push(...x.facts),u.push({version:f,log:x.console}),Z({...x.result,digest:x.digest}),a.set(F,x);continue}R.push(`${s.id}/${w}/${C}/${M}`);const b=await i.time("load (mount, stills)",()=>n.open(s,f));try{const g=b.summary,L=[],P=[...g?.facts??[]],ee={problems:L,facts:P},te={target:f,layout:()=>i.time("layout measure",()=>fe(s,t.kinds)?b.measure():ze(n,s,b,{fresh:e.fresh===!0}))};let ne=!1;try{if(g){try{await y.layout?.(b,ee,te)}catch(l){if(l instanceof we)throw l}if(p)for(const l of d){const I=l.facts?.bind(l);I&&P.push(...await i.time("layers' facts",()=>I(b)))}}if(g&&E&&(T=!0,ne=!0,L.push(...await i.time("determinism",()=>determinism(b,`${s.id}:${w}:${M}`,o))),await y.timing?.(b,ee,te)),g&&p)for(const l of d){const I=l.readBack?.bind(l);I&&P.push(...await i.time("layers read back",()=>I(b)))}}catch(l){if(!(l instanceof we))throw l;l.kept||L.push(me("AK-P003",l.message,{piece:f.piece,output:f.output,combo:f.combo,format:f.format}))}L.push(...await b.problems());const ie=he(L);$.problems.push(...ie);const se=y.keep?.bind(y),oe=se?P.filter(l=>se(l)):P;$.facts.push(...oe);const re=await b.console();u.push({version:f,log:re});const O=g?pe(t,q,s,h,g.reads):void 0,ce={...f,...g?{timeline:g.timeline,reads:g.reads}:{}};Z({...ce,...O?{digest:O}:{}}),O&&a.set(F,{digest:O,result:ce,problems:ie,facts:oe,sampled:ne,...p?{}:{factless:!0},console:re})}finally{await b.close()}}return{...$,loaded:X,combos:v.map(m=>{const h=j(s.matrix,m);return{combo:m,...h===void 0?{}:{id:h}}}),media:W}},Q=await N(t.kinds,s),xe={root:t.root,piece:s,prepared:t,facts:p,...e.ffmpeg===void 0?{}:{ffmpeg:e.ffmpeg},mediaPath:y=>n.mediaPath(y),time:(y,$)=>i.time(y,$),versions:J},V=Q?.checkPiece?.bind(Q),A=V?await V(xe):await J({});k.push(...A.problems),S.push(...A.facts),G.push(...A.wholes??[])}for(const s of t.items){const w=await N(t.kinds,s);if(!w?.check||e.piece!==void 0&&!B({id:s.id,path:s.entry},e.piece))continue;const M=w.check.bind(w);k.push(...await i.time("items' own checks",()=>M(s,{root:t.root})))}await a.save(new Set(t.pieces.map(s=>s.id)));const Y=he(k).sort(Ye);for(const s of d){const w=s.current?.bind(s);w&&(S=await w(S,{root:t.root}))}i.report();const ye=new Set(t.pieces.map(s=>s.place)),_={};for(const s of t.items)ye.has(s.id)||(_[s.kind]=(_[s.kind]??0)+1);return{targets:K,items:_,check:summarize(Y),problems:Y,facts:S,results:H,wholes:G,stats:checkStats(K.length,R,z,U),console:Ne(r,u)}}finally{e.session||await n.close()}}
|
|
3
|
+
`)}}const Je=(e,i)=>{const n=new Set(Ce(e,i));return e.filter(t=>n.has(t)||t.layers===!0)};async function Qe(e){const i=[],n=new Set;for(const t of e){if(t.layers!==!0)continue;const o=await N(e,{kind:t.id});!o?.layers||n.has(o)||(n.add(o),i.push(o.layers))}return i}export async function runCheck(e){const i=new qe,n=e.session??await i.time("prepare (discover, metadata, bundle)",()=>Be.open({root:e.dir,kinds:Ue(e.kinds),...e.buildDir===void 0?{}:{buildDir:e.buildDir},...e.gpu===void 0?{}:{gpu:e.gpu},...e.consoleLimit===void 0?{}:{consoleLimit:e.consoleLimit}}));try{const t=n.prepared,o=e.samples??12,r=n.consoleLimit,c=await He(),a=await _e.open(t.root,await Te({kinds:Je(t.kinds,t.items),runtimeSha:c,samples:o,gpu:n.gpu,...r===Ke?{}:{consoleLimit:r}})),p=e.facts!==!1,d=await Qe(t.kinds),u=[],k=[...askedProblems(t,e.piece),...e.files===void 0?[]:await ve(t.root,t.files.filter(s=>e.piece===void 0||Pe(s,e.piece.replace(/^\.\//u,"").replace(/\/+$/u,""))),t.items,e.files),...e.files===void 0||e.piece!==void 0?[]:await De(t.root,t.files,t.kinds,e.files)];let S=[];const K=[],H=[],R=[];let z=0,U=0;const G=[],ke=t.pieces.filter(s=>e.piece===void 0||B({id:s.id,path:s.place},e.piece));for(const s of ke){if(!t.bundle?.chunks.entries[s.id.replaceAll("/","__")])continue;const w=s.kind,M=s.format,q=await je(t,s,c),J=async y=>{const $={problems:[],facts:[]},W=new Set,v=[...s.combos.filter(m=>!e.combos?.length||e.combos.some(h=>Fe(m,h,j(s.matrix,m)))),...Re(s,e.combos)],Se=new Set(s.matrix?Oe(s.matrix.space,s.dims,v):v.keys()),X=[],Z=m=>{H.push(m);for(const h of m.reads?.media??[])W.add(h.path);m.timeline&&X.push({...m,timeline:m.timeline})};let T=!1;const $e=(m,h,D)=>{if(e.fresh===!0)return;const f=a.get(m),C=f?.result.reads,E=f?.result.timeline;return!f||!C||!E||D&&!f.sampled||f.factless===!0&&p?void 0:pe(t,q,s,h,C)===f.digest?f:void 0};for(const[m,h]of v.entries()){const D=j(s.matrix,h),f={piece:s.id,output:w,combo:h,format:M},C=le(h);if(K.push({...f,...D?{id:D}:{},key:C}),!Se.has(m)){U++;continue}const E=fe(s,t.kinds)&&!T,F=Ae(s.id,w,C,M),x=$e(F,h,E);if(x){z++,x.sampled&&(T=!0),$.problems.push(...x.problems),$.facts.push(...x.facts),u.push({version:f,log:x.console}),Z({...x.result,digest:x.digest}),a.set(F,x);continue}R.push(`${s.id}/${w}/${C}/${M}`);const b=await i.time("load (mount, stills)",()=>n.open(s,f));try{const g=b.summary,L=[],P=[...g?.facts??[]],ee={problems:L,facts:P},te={target:f,layout:()=>i.time("layout measure",()=>fe(s,t.kinds)?b.measure():ze(n,s,b,{fresh:e.fresh===!0}))};let ne=!1;try{if(g){try{await y.layout?.(b,ee,te)}catch(l){if(l instanceof we)throw l}if(p)for(const l of d){const I=l.facts?.bind(l);I&&P.push(...await i.time("layers' facts",()=>I(b)))}}if(g&&E&&(T=!0,ne=!0,L.push(...await i.time("determinism",()=>determinism(b,`${s.id}:${w}:${M}`,o))),await y.timing?.(b,ee,te)),g&&p)for(const l of d){const I=l.readBack?.bind(l);I&&P.push(...await i.time("layers read back",()=>I(b)))}}catch(l){if(!(l instanceof we))throw l;l.kept||L.push(me("AK-P003",l.message,{piece:f.piece,output:f.output,combo:f.combo,format:f.format}))}L.push(...await b.problems());const ie=he(L);$.problems.push(...ie);const se=y.keep?.bind(y),oe=se?P.filter(l=>se(l)):P;$.facts.push(...oe);const re=await b.console();u.push({version:f,log:re});const O=g?pe(t,q,s,h,g.reads):void 0,ce={...f,...g?{timeline:g.timeline,reads:g.reads}:{}};Z({...ce,...O?{digest:O}:{}}),O&&a.set(F,{digest:O,result:ce,problems:ie,facts:oe,sampled:ne,...p?{}:{factless:!0},console:re})}finally{await b.close()}}return{...$,loaded:X,combos:v.map(m=>{const h=j(s.matrix,m);return{combo:m,...h===void 0?{}:{id:h}}}),media:W}},Q=await N(t.kinds,s),xe={root:t.root,piece:s,prepared:t,facts:p,...e.ffmpeg===void 0?{}:{ffmpeg:e.ffmpeg},mediaPath:y=>n.mediaPath(y),time:(y,$)=>i.time(y,$),versions:J},V=Q?.checkPiece?.bind(Q),A=V?await V(xe):await J({});k.push(...A.problems),S.push(...A.facts),G.push(...A.wholes??[])}for(const s of t.items){const w=await N(t.kinds,s);if(!w?.check||e.piece!==void 0&&!B({id:s.id,path:s.entry},e.piece))continue;const M=w.check.bind(w);k.push(...await i.time("items' own checks",()=>M(s,{root:t.root,data:t.data})))}await a.save(new Set(t.pieces.map(s=>s.id)));const Y=he(k).sort(Ye);for(const s of d){const w=s.current?.bind(s);w&&(S=await w(S,{root:t.root}))}i.report();const ye=new Set(t.pieces.map(s=>s.place)),_={};for(const s of t.items)ye.has(s.id)||(_[s.kind]=(_[s.kind]??0)+1);return{targets:K,items:_,check:summarize(Y),problems:Y,facts:S,results:H,wholes:G,stats:checkStats(K.length,R,z,U),console:Ne(r,u)}}finally{e.session||await n.close()}}
|