@peter.prib/renderengine 0.0.0-stage → 0.2.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/LICENSE +21 -0
- package/README.md +203 -2
- package/REFERENCE.md +2198 -0
- package/dist/renderengine-workspace.umd.js +46905 -0
- package/dist/renderengine.umd.js +42223 -0
- package/examples/archimate.html +66 -0
- package/examples/diagram-editor.html +51 -0
- package/package.json +65 -4
- package/src/BaseRenderer.js +57 -0
- package/src/CanvasRenderer.js +194 -0
- package/src/Mat4.js +111 -0
- package/src/OrbitCamera.js +57 -0
- package/src/RendererFactory.js +50 -0
- package/src/SVGRenderer.js +439 -0
- package/src/archimate.js +723 -0
- package/src/archimateArchiFormat.js +1693 -0
- package/src/archimateArchiTypes.js +72 -0
- package/src/archimateArchive.js +140 -0
- package/src/archimateCSV.js +127 -0
- package/src/archimateDrawio.js +182 -0
- package/src/archimateExchangeFormat.js +546 -0
- package/src/archimateRelationshipTable.js +93 -0
- package/src/archimateSpecializations.js +161 -0
- package/src/chartCatalog.js +589 -0
- package/src/charting/ArchimateDiagramEditor.js +1624 -0
- package/src/charting/ArchimateSpecializationSelector.js +134 -0
- package/src/charting/Axis.js +68 -0
- package/src/charting/CameraSeeder.js +30 -0
- package/src/charting/CatalogDialog.js +92 -0
- package/src/charting/Chart.js +37 -0
- package/src/charting/Chart3D.js +99 -0
- package/src/charting/ChartBox.js +80 -0
- package/src/charting/ChartData.js +27 -0
- package/src/charting/ChartRegistry.js +76 -0
- package/src/charting/CheckboxTreeSelector.js +304 -0
- package/src/charting/ColorField.js +107 -0
- package/src/charting/ColorPalette.js +88 -0
- package/src/charting/CommandHistory.js +176 -0
- package/src/charting/DataFilter.js +52 -0
- package/src/charting/Diagram.js +36 -0
- package/src/charting/Diagram3D.js +29 -0
- package/src/charting/DiagramClipboard.js +31 -0
- package/src/charting/DiagramEditor.js +3330 -0
- package/src/charting/DiagramEditorCommand.js +110 -0
- package/src/charting/DiagramEditorCommands.js +237 -0
- package/src/charting/DiagramEditorEdgeCommands.js +142 -0
- package/src/charting/DiagramEditorState.js +98 -0
- package/src/charting/DiagramRegistry.js +86 -0
- package/src/charting/DiagramTypeRegistry.js +326 -0
- package/src/charting/DiagramViewPropertiesDialog.js +46 -0
- package/src/charting/Edge.js +113 -0
- package/src/charting/ErrorBars.js +37 -0
- package/src/charting/FilterSystem.js +285 -0
- package/src/charting/FindReplaceDialog.js +139 -0
- package/src/charting/FormDialog.js +385 -0
- package/src/charting/Gauge.js +58 -0
- package/src/charting/Hierarchy.js +175 -0
- package/src/charting/HintPanel.js +86 -0
- package/src/charting/ImageSelector.js +148 -0
- package/src/charting/InteractionManager.js +725 -0
- package/src/charting/Legend.js +58 -0
- package/src/charting/MenuBar.js +62 -0
- package/src/charting/ModelFileFormat.js +115 -0
- package/src/charting/OrbitControls.js +77 -0
- package/src/charting/Palette.js +119 -0
- package/src/charting/PopupMenu.js +117 -0
- package/src/charting/PropertiesPanel.js +155 -0
- package/src/charting/PropertyListEditor.js +96 -0
- package/src/charting/PropertyLog.js +92 -0
- package/src/charting/SettingsCascade.js +93 -0
- package/src/charting/SettingsDialog.js +53 -0
- package/src/charting/SettingsManager.js +179 -0
- package/src/charting/SettingsViewPropertiesDialog.js +58 -0
- package/src/charting/ShapePaths.js +27 -0
- package/src/charting/Statistics.js +134 -0
- package/src/charting/TemplateCatalog.js +59 -0
- package/src/charting/TemplateLibrary.js +103 -0
- package/src/charting/TextStyle.js +168 -0
- package/src/charting/ViewFit.js +55 -0
- package/src/charting/ViewMenu.js +70 -0
- package/src/charting/ViewPropertiesDialog.js +77 -0
- package/src/charting/ViewTabStrip.js +81 -0
- package/src/charting/archimate/ArchiFileFormat.js +32 -0
- package/src/charting/archimate/ArchimateCanvasEditor.js +815 -0
- package/src/charting/archimate/ArchimateCsvFileFormat.js +35 -0
- package/src/charting/archimate/ArchimateEdge.js +137 -0
- package/src/charting/archimate/ArchimateElementTemplate.js +195 -0
- package/src/charting/archimate/ArchimatePalette.js +102 -0
- package/src/charting/archimate/CsvImportDialog.js +105 -0
- package/src/charting/archimate/CustomViewpoints.js +74 -0
- package/src/charting/archimate/DerivedEdge.js +29 -0
- package/src/charting/archimate/DrawioFileFormat.js +24 -0
- package/src/charting/archimate/ElementFilterRule.js +21 -0
- package/src/charting/archimate/ExchangeFileFormat.js +28 -0
- package/src/charting/archimate/ViewGroupTemplate.js +137 -0
- package/src/charting/archimate/ViewLineEdge.js +84 -0
- package/src/charting/archimate/ViewpointRule.js +45 -0
- package/src/charting/archimate/archimateFileFormats.js +12 -0
- package/src/charting/archimate/archimateNames.js +5 -0
- package/src/charting/archimate/csvMapping.js +122 -0
- package/src/charting/archimate/elementMenuItems.js +32 -0
- package/src/charting/archimate/elementProperties.js +146 -0
- package/src/charting/archimate/elementTypeChoices.js +7 -0
- package/src/charting/archimate/elementTypeGroups.js +19 -0
- package/src/charting/archimate/index.js +17 -0
- package/src/charting/archimate/specializationCatalogDialog.js +64 -0
- package/src/charting/archimate/typeGlyph.js +29 -0
- package/src/charting/arrangement/Arrangement.js +112 -0
- package/src/charting/arrangement/ArrangementCommand.js +29 -0
- package/src/charting/arrangement/BackgroundCommand.js +41 -0
- package/src/charting/arrangement/BackgroundGroup.js +18 -0
- package/src/charting/arrangement/GroupCommand.js +46 -0
- package/src/charting/arrangement/ItemGroup.js +62 -0
- package/src/charting/arrangement/LockCommand.js +32 -0
- package/src/charting/arrangement/UngroupCommand.js +27 -0
- package/src/charting/arrangement/alignment.js +88 -0
- package/src/charting/arrangement/arrangeMenuItems.js +25 -0
- package/src/charting/arrangement/index.js +11 -0
- package/src/charting/arrangement/layouts.js +233 -0
- package/src/charting/canvas/ArchiHint.js +78 -0
- package/src/charting/canvas/CanvasBoxKind.js +39 -0
- package/src/charting/canvas/CanvasPalette.js +49 -0
- package/src/charting/canvas/CanvasTemplateLibrary.js +61 -0
- package/src/charting/canvas/CanvasTemplateMenu.js +151 -0
- package/src/charting/canvas/EditHintCommand.js +28 -0
- package/src/charting/canvas/canvasBoxKinds.js +27 -0
- package/src/charting/canvas/canvasBoxMenuItems.js +40 -0
- package/src/charting/canvas/defaultCanvasTemplates.js +186 -0
- package/src/charting/canvas/diagramBoxKinds.js +12 -0
- package/src/charting/canvas/hintMenuItems.js +49 -0
- package/src/charting/charts/ArcGauge.js +55 -0
- package/src/charting/charts/AreaChart.js +71 -0
- package/src/charting/charts/BarChart.js +80 -0
- package/src/charting/charts/BarChart3D.js +56 -0
- package/src/charting/charts/BarChart3DOrbit.js +53 -0
- package/src/charting/charts/BarChartBase.js +70 -0
- package/src/charting/charts/BarGauge.js +42 -0
- package/src/charting/charts/BoxPlotChart.js +41 -0
- package/src/charting/charts/BubbleChart.js +99 -0
- package/src/charting/charts/BubbleChart3D.js +78 -0
- package/src/charting/charts/BulletGauge.js +87 -0
- package/src/charting/charts/CalendarHeatmapChart.js +204 -0
- package/src/charting/charts/CandlestickChart.js +54 -0
- package/src/charting/charts/ChordDiagram.js +130 -0
- package/src/charting/charts/DensityChart.js +73 -0
- package/src/charting/charts/DialGauge.js +65 -0
- package/src/charting/charts/DonutChart.js +15 -0
- package/src/charting/charts/FunnelChart.js +47 -0
- package/src/charting/charts/GanttChart.js +201 -0
- package/src/charting/charts/GaugeChart.js +175 -0
- package/src/charting/charts/GeoMapChart.js +146 -0
- package/src/charting/charts/GroupedBarChart.js +88 -0
- package/src/charting/charts/GroupedDistributionChart.js +70 -0
- package/src/charting/charts/HeatmapChart.js +80 -0
- package/src/charting/charts/HierarchyChart.js +39 -0
- package/src/charting/charts/HistogramChart.js +45 -0
- package/src/charting/charts/KpiTile.js +72 -0
- package/src/charting/charts/LagPlotChart.js +41 -0
- package/src/charting/charts/LineChart.js +124 -0
- package/src/charting/charts/MultiRingGauge.js +54 -0
- package/src/charting/charts/OutlineChart.js +95 -0
- package/src/charting/charts/ParallelCoordinatesChart.js +130 -0
- package/src/charting/charts/PieChart.js +56 -0
- package/src/charting/charts/PipeChart.js +88 -0
- package/src/charting/charts/PopulationPyramidChart.js +106 -0
- package/src/charting/charts/QQPlotChart.js +64 -0
- package/src/charting/charts/RadarChart.js +76 -0
- package/src/charting/charts/RadialBarChart.js +96 -0
- package/src/charting/charts/RingGauge.js +23 -0
- package/src/charting/charts/SankeyDiagram.js +174 -0
- package/src/charting/charts/ScatterChart.js +104 -0
- package/src/charting/charts/StackedAreaChart.js +15 -0
- package/src/charting/charts/StackedBarChart.js +33 -0
- package/src/charting/charts/StackedBarChart3DOrbit.js +58 -0
- package/src/charting/charts/StreamGraphChart.js +131 -0
- package/src/charting/charts/SunburstChart.js +57 -0
- package/src/charting/charts/ThermometerGauge.js +43 -0
- package/src/charting/charts/TreemapChart.js +54 -0
- package/src/charting/charts/ViolinChart.js +37 -0
- package/src/charting/charts/WaterfallChart.js +66 -0
- package/src/charting/charts/WordCloudChart.js +104 -0
- package/src/charting/diagramModel/AddViewCommand.js +33 -0
- package/src/charting/diagramModel/DiagramModel.js +39 -0
- package/src/charting/diagramModel/DiagramModelSearch.js +22 -0
- package/src/charting/diagramModel/DiagramView.js +50 -0
- package/src/charting/diagramModel/ModelHistory.js +43 -0
- package/src/charting/diagramModel/ModelReport.js +153 -0
- package/src/charting/diagramModel/ModelSearch.js +223 -0
- package/src/charting/diagramModel/RemoveViewCommand.js +25 -0
- package/src/charting/diagramModel/RenameViewCommand.js +21 -0
- package/src/charting/diagramModel/ReplaceTextCommand.js +25 -0
- package/src/charting/diagramModel/ViewSetChecker.js +34 -0
- package/src/charting/diagramModel/ViewSetModel.js +243 -0
- package/src/charting/diagramModel/index.js +6 -0
- package/src/charting/diagramModel/nameTransforms.js +29 -0
- package/src/charting/diagrams/ArchimateCommands.js +141 -0
- package/src/charting/diagrams/ArchimateDiagram.js +263 -0
- package/src/charting/diagrams/ArchimateModel.js +1155 -0
- package/src/charting/diagrams/ArchimateModelChecker.js +125 -0
- package/src/charting/diagrams/ArchimateModelReport.js +128 -0
- package/src/charting/diagrams/ArchimateModelSearch.js +41 -0
- package/src/charting/diagrams/ArchimateValidator.js +357 -0
- package/src/charting/diagrams/CanvasView.js +112 -0
- package/src/charting/diagrams/ContextMenu.js +37 -0
- package/src/charting/diagrams/DataModelDiagram.js +86 -0
- package/src/charting/diagrams/DataModelRelationshipStrategy.js +38 -0
- package/src/charting/diagrams/DerivedRelationships.js +102 -0
- package/src/charting/diagrams/EbnfDiagram.js +39 -0
- package/src/charting/diagrams/EdgeGeometry.js +553 -0
- package/src/charting/diagrams/EditViewItemCommand.js +128 -0
- package/src/charting/diagrams/ElementInstance.js +157 -0
- package/src/charting/diagrams/GraphDiagram.js +1340 -0
- package/src/charting/diagrams/GraphDiagram3D.js +152 -0
- package/src/charting/diagrams/GraphMetrics.js +81 -0
- package/src/charting/diagrams/GridOverlay.js +137 -0
- package/src/charting/diagrams/ImportRowsCommand.js +62 -0
- package/src/charting/diagrams/LabelHelper.js +108 -0
- package/src/charting/diagrams/MergeElementsCommand.js +101 -0
- package/src/charting/diagrams/NestInstanceCommand.js +34 -0
- package/src/charting/diagrams/NodeGeometry.js +158 -0
- package/src/charting/diagrams/PlaceItemsCommand.js +77 -0
- package/src/charting/diagrams/RadialLayout.js +101 -0
- package/src/charting/diagrams/RelationshipInstance.js +93 -0
- package/src/charting/diagrams/RemoveGroupFromViewCommand.js +28 -0
- package/src/charting/diagrams/RemoveLineCommand.js +27 -0
- package/src/charting/diagrams/ShowElementCommand.js +43 -0
- package/src/charting/diagrams/SvgCoordinate.js +17 -0
- package/src/charting/diagrams/SvgZoom.js +127 -0
- package/src/charting/diagrams/Tooltip.js +62 -0
- package/src/charting/diagrams/ViewConnectionInstance.js +102 -0
- package/src/charting/diagrams/ViewObjectInstance.js +56 -0
- package/src/charting/diagrams/commands/AddEdgeCommand.js +34 -0
- package/src/charting/diagrams/commands/AddNodeCommand.js +28 -0
- package/src/charting/diagrams/commands/AddWaypointCommand.js +27 -0
- package/src/charting/diagrams/commands/CreateFolderCommand.js +27 -0
- package/src/charting/diagrams/commands/DeleteEdgeCommand.js +30 -0
- package/src/charting/diagrams/commands/DeleteFolderCommand.js +47 -0
- package/src/charting/diagrams/commands/DeleteNodeCommand.js +35 -0
- package/src/charting/diagrams/commands/DeleteWaypointCommand.js +24 -0
- package/src/charting/diagrams/commands/GraphCommand.js +65 -0
- package/src/charting/diagrams/commands/InvertEdgeCommand.js +24 -0
- package/src/charting/diagrams/commands/MoveNodeCommand.js +44 -0
- package/src/charting/diagrams/commands/MoveWaypointCommand.js +27 -0
- package/src/charting/diagrams/commands/RenameEdgeCommand.js +23 -0
- package/src/charting/diagrams/commands/RenameFolderCommand.js +31 -0
- package/src/charting/diagrams/commands/RenameNodeCommand.js +27 -0
- package/src/charting/diagrams/commands/ResizeNodeCommand.js +46 -0
- package/src/charting/diagrams/commands/UpdateEdgeSideCommand.js +40 -0
- package/src/charting/diagrams/commands/index.js +17 -0
- package/src/charting/diagrams/duplicates.js +49 -0
- package/src/charting/diagrams/nesting.js +30 -0
- package/src/charting/diagrams/roadmap.js +77 -0
- package/src/charting/edgeMarkers/ArrowMarker.js +15 -0
- package/src/charting/edgeMarkers/CircleMarker.js +13 -0
- package/src/charting/edgeMarkers/CrowsFootMarker.js +16 -0
- package/src/charting/edgeMarkers/DiamondMarker.js +15 -0
- package/src/charting/edgeMarkers/EdgeMarker.js +34 -0
- package/src/charting/edgeMarkers/HalfArrowMarker.js +8 -0
- package/src/charting/edgeMarkers/HollowDiamondMarker.js +18 -0
- package/src/charting/edgeMarkers/HollowTriangleMarker.js +18 -0
- package/src/charting/edgeMarkers/OpenArrowMarker.js +17 -0
- package/src/charting/edgeMarkers/index.js +27 -0
- package/src/charting/edgeStyle/EdgeStyleCascade.js +22 -0
- package/src/charting/edgeStyle/EdgeStyleDialog.js +51 -0
- package/src/charting/edgeStyle/EdgeStyleSchema.js +43 -0
- package/src/charting/edgeStyle/SetStyleCommand.js +12 -0
- package/src/charting/edgeStyle/index.js +4 -0
- package/src/charting/emphasis/EmphasisRule.js +42 -0
- package/src/charting/emphasis/HighlightRule.js +24 -0
- package/src/charting/gauges/ArcTrack.js +51 -0
- package/src/charting/gauges/GaugeAnimation.js +51 -0
- package/src/charting/gauges/GaugeBands.js +48 -0
- package/src/charting/gauges/GaugeScale.js +87 -0
- package/src/charting/gauges/GaugeTrack.js +44 -0
- package/src/charting/gauges/GaugeValue.js +61 -0
- package/src/charting/gauges/HorizontalTrack.js +14 -0
- package/src/charting/gauges/LinearTrack.js +29 -0
- package/src/charting/gauges/Sparkline.js +42 -0
- package/src/charting/gauges/VerticalTrack.js +17 -0
- package/src/charting/glyphs/ArrowGlyph.js +21 -0
- package/src/charting/glyphs/BatteryGlyph.js +18 -0
- package/src/charting/glyphs/ChevronGlyph.js +18 -0
- package/src/charting/glyphs/CircleGlyph.js +15 -0
- package/src/charting/glyphs/CloudGlyph.js +19 -0
- package/src/charting/glyphs/ComponentGlyph.js +18 -0
- package/src/charting/glyphs/ConstraintGlyph.js +24 -0
- package/src/charting/glyphs/ContractBoxGlyph.js +10 -0
- package/src/charting/glyphs/CubeGlyph.js +19 -0
- package/src/charting/glyphs/CylinderGlyph.js +19 -0
- package/src/charting/glyphs/DashedDoubleArrowGlyph.js +11 -0
- package/src/charting/glyphs/DeviceGlyph.js +17 -0
- package/src/charting/glyphs/DiamondGlyph.js +17 -0
- package/src/charting/glyphs/DocumentGlyph.js +17 -0
- package/src/charting/glyphs/DoubleArrowGlyph.js +23 -0
- package/src/charting/glyphs/DoubleCircleGlyph.js +24 -0
- package/src/charting/glyphs/EllipseGlyph.js +18 -0
- package/src/charting/glyphs/FactoryGlyph.js +20 -0
- package/src/charting/glyphs/FlagGlyph.js +16 -0
- package/src/charting/glyphs/GapCircleGlyph.js +17 -0
- package/src/charting/glyphs/GearGlyph.js +37 -0
- package/src/charting/glyphs/Glyph.js +98 -0
- package/src/charting/glyphs/GroupingBoxGlyph.js +13 -0
- package/src/charting/glyphs/HalfCircleGlyph.js +22 -0
- package/src/charting/glyphs/HexagonGlyph.js +28 -0
- package/src/charting/glyphs/IconGlyph.js +22 -0
- package/src/charting/glyphs/ImageGlyph.js +16 -0
- package/src/charting/glyphs/JunctionGlyph.js +17 -0
- package/src/charting/glyphs/LollipopGlyph.js +22 -0
- package/src/charting/glyphs/MagnifierGlyph.js +17 -0
- package/src/charting/glyphs/NoteGlyph.js +33 -0
- package/src/charting/glyphs/ObjectBoxGlyph.js +21 -0
- package/src/charting/glyphs/OrJunctionGlyph.js +17 -0
- package/src/charting/glyphs/ParallelogramGlyph.js +20 -0
- package/src/charting/glyphs/PersonGlyph.js +23 -0
- package/src/charting/glyphs/PillGlyph.js +23 -0
- package/src/charting/glyphs/PinGlyph.js +18 -0
- package/src/charting/glyphs/PrincipleGlyph.js +23 -0
- package/src/charting/glyphs/ProductBoxGlyph.js +16 -0
- package/src/charting/glyphs/RectGlyph.js +15 -0
- package/src/charting/glyphs/RoundedBoxGlyph.js +13 -0
- package/src/charting/glyphs/StackGlyph.js +14 -0
- package/src/charting/glyphs/StepsGlyph.js +20 -0
- package/src/charting/glyphs/StickFigureGlyph.js +32 -0
- package/src/charting/glyphs/SystemSoftwareBoxGlyph.js +16 -0
- package/src/charting/glyphs/TabbedBoxGlyph.js +37 -0
- package/src/charting/glyphs/TargetGlyph.js +23 -0
- package/src/charting/glyphs/WavyBoxGlyph.js +17 -0
- package/src/charting/glyphs/WheelGlyph.js +28 -0
- package/src/charting/glyphs/drawGlyph.js +28 -0
- package/src/charting/glyphs/glyphSvg.js +55 -0
- package/src/charting/glyphs/index.js +109 -0
- package/src/charting/modelTree/AnalysisPanel.js +159 -0
- package/src/charting/modelTree/DiagramTabs.js +217 -0
- package/src/charting/modelTree/ModelTree.js +164 -0
- package/src/charting/modelTree/ModelTreePanel.js +914 -0
- package/src/charting/modelTree/TreeBuilder.js +238 -0
- package/src/charting/modelTree/TreeModeRegistry.js +51 -0
- package/src/charting/modelTree/TreeViewMode.js +110 -0
- package/src/charting/modelTree/buildFilterTrees.js +138 -0
- package/src/charting/modelTree/modes/FlatTreeMode.js +46 -0
- package/src/charting/modelTree/modes/LayerGroupedTreeMode.js +62 -0
- package/src/charting/modelTree/modes/TypeGroupedTreeMode.js +60 -0
- package/src/charting/modelTree/treeLayers.js +11 -0
- package/src/charting/report/reportHtml.js +82 -0
- package/src/charting/report/reportViewer.js +118 -0
- package/src/charting/shapes/CircleShape.js +19 -0
- package/src/charting/shapes/PathShape.js +17 -0
- package/src/charting/shapes/RectShape.js +20 -0
- package/src/charting/shapes/Shape.js +20 -0
- package/src/charting/shapes/ShapeFactory.js +23 -0
- package/src/charting/storage/LocalJsonStore.js +43 -0
- package/src/charting/templates/ActorTemplate.js +36 -0
- package/src/charting/templates/BoxTemplate.js +27 -0
- package/src/charting/templates/CircleTemplate.js +18 -0
- package/src/charting/templates/ClassTemplate.js +20 -0
- package/src/charting/templates/CloudTemplate.js +43 -0
- package/src/charting/templates/ComponentTemplate.js +19 -0
- package/src/charting/templates/CylinderTemplate.js +30 -0
- package/src/charting/templates/DataStoreTemplate.js +16 -0
- package/src/charting/templates/DiamondTemplate.js +10 -0
- package/src/charting/templates/DocumentTemplate.js +32 -0
- package/src/charting/templates/EllipseTemplate.js +15 -0
- package/src/charting/templates/FinalStateTemplate.js +12 -0
- package/src/charting/templates/GlyphTemplate.js +47 -0
- package/src/charting/templates/HexagonTemplate.js +17 -0
- package/src/charting/templates/LifelineTemplate.js +20 -0
- package/src/charting/templates/ManualInputTemplate.js +12 -0
- package/src/charting/templates/NoteTemplate.js +23 -0
- package/src/charting/templates/OctagonTemplate.js +7 -0
- package/src/charting/templates/PackageTemplate.js +25 -0
- package/src/charting/templates/ParallelogramTemplate.js +11 -0
- package/src/charting/templates/PentagonTemplate.js +5 -0
- package/src/charting/templates/PolygonTemplate.js +18 -0
- package/src/charting/templates/PredefinedProcessTemplate.js +13 -0
- package/src/charting/templates/RectangleTemplate.js +28 -0
- package/src/charting/templates/RegularPolygonTemplate.js +21 -0
- package/src/charting/templates/RoundedRectangleTemplate.js +5 -0
- package/src/charting/templates/StadiumTemplate.js +8 -0
- package/src/charting/templates/StarTemplate.js +17 -0
- package/src/charting/templates/SwimlaneTemplate.js +18 -0
- package/src/charting/templates/Template.js +208 -0
- package/src/charting/templates/TrapezoidTemplate.js +11 -0
- package/src/charting/templates/TriangleTemplate.js +12 -0
- package/src/charting/templates/index.js +31 -0
- package/src/charting/templates/outline.js +59 -0
- package/src/charting/templates/svg.js +19 -0
- package/src/charting/textToShapes.js +61 -0
- package/src/charting/toolbar/ToolbarButton.js +38 -0
- package/src/charting/toolbar/ToolbarCheckbox.js +31 -0
- package/src/charting/toolbar/ToolbarItem.js +19 -0
- package/src/charting/toolbar/ToolbarMenu.js +36 -0
- package/src/charting/toolbar/ToolbarSelect.js +38 -0
- package/src/charting/toolbar/ToolbarSeparator.js +7 -0
- package/src/charting/toolbar/ToolbarText.js +22 -0
- package/src/charting/toolbar/index.js +8 -0
- package/src/charting/toolbar/pickFile.js +14 -0
- package/src/charting/viewDecorations.js +85 -0
- package/src/charting/zOrder.js +57 -0
- package/src/csvTable.js +61 -0
- package/src/datamodel.js +122 -0
- package/src/datawindow/BoundedWindow.js +36 -0
- package/src/datawindow/FlatDataWindow.js +34 -0
- package/src/datawindow/GraphDataWindow.js +40 -0
- package/src/datawindow/GroupedSampleDataWindow.js +16 -0
- package/src/datawindow/SeriesDataWindow.js +42 -0
- package/src/datawindow/index.js +31 -0
- package/src/diagramCatalog.js +30 -0
- package/src/ebnfDiagram.js +57 -0
- package/src/ebnfParser.js +129 -0
- package/src/exportImage.js +233 -0
- package/src/index.js +2636 -0
- package/src/itIcons.js +84 -0
- package/src/kernelExpr.js +243 -0
- package/src/propertiesDialog.js +463 -0
- package/src/railroadDiagram.js +571 -0
- package/src/treeModeCatalog.js +16 -0
- package/src/workspace/ContextBus.js +79 -0
- package/src/workspace/EditorShell.js +67 -0
- package/src/workspace/Part.js +163 -0
- package/src/workspace/PartFactory.js +49 -0
- package/src/workspace/PartRegistry.js +86 -0
- package/src/workspace/Workspace.js +321 -0
- package/src/workspace/archimateServices.js +33 -0
- package/src/workspace/dom.js +120 -0
- package/src/workspace/index.js +75 -0
- package/src/workspace/layout/GridNode.js +280 -0
- package/src/workspace/layout/LayoutNode.js +89 -0
- package/src/workspace/layout/PartNode.js +77 -0
- package/src/workspace/layout/SplitNode.js +114 -0
- package/src/workspace/layout/TabsNode.js +191 -0
- package/src/workspace/layout/index.js +24 -0
- package/src/workspace/parts/AdapterPart.js +33 -0
- package/src/workspace/parts/ArchimateCanvasPart.js +345 -0
- package/src/workspace/parts/ArchimateEditorPart.js +79 -0
- package/src/workspace/parts/ChartPart.js +115 -0
- package/src/workspace/parts/ContentPart.js +34 -0
- package/src/workspace/parts/DetailPart.js +46 -0
- package/src/workspace/parts/DiagramEditorPart.js +135 -0
- package/src/workspace/parts/EditorPart.js +388 -0
- package/src/workspace/parts/HtmlPart.js +25 -0
- package/src/workspace/parts/ListPart.js +57 -0
- package/src/workspace/parts/ModelFile.js +187 -0
- package/src/workspace/parts/ModelsPart.js +135 -0
- package/src/workspace/styles.js +258 -0
- package/src/workspace/themes.js +96 -0
- package/src/workspace/workArea.js +413 -0
- package/src/workspace/workAreaModel.js +197 -0
- package/src/workspace.js +16 -0
- package/src/zip/ZipArchive.js +160 -0
- package/src/zip/crc32.js +25 -0
- package/src/zip/inflate.js +159 -0
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { Chart } from '../Chart.js';
|
|
2
|
+
import { ChartBox } from '../ChartBox.js';
|
|
3
|
+
import { ColorPalette } from '../ColorPalette.js';
|
|
4
|
+
import { Axis } from '../Axis.js';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* HeatmapChart — a grid of cells, one per (x, y) category pair, shaded by
|
|
8
|
+
* `value` along a low→high color scale.
|
|
9
|
+
*/
|
|
10
|
+
export class HeatmapChart extends Chart {
|
|
11
|
+
static chartType = 'heatmap';
|
|
12
|
+
|
|
13
|
+
_render() {
|
|
14
|
+
const data = this.data;
|
|
15
|
+
const options = this.options;
|
|
16
|
+
const box = ChartBox.fromRenderer(this.renderer);
|
|
17
|
+
const {
|
|
18
|
+
x = box.x, y = box.y, width = box.width, height = box.height,
|
|
19
|
+
xLabels, yLabels, colorScale = ['#f7fbff', '#4292c6', '#08306b'],
|
|
20
|
+
showValues = false, title,
|
|
21
|
+
} = options;
|
|
22
|
+
|
|
23
|
+
// Grid cost is xCats.length * yCats.length, NOT data.length — a row
|
|
24
|
+
// count that's perfectly reasonable elsewhere (say, 100) can still
|
|
25
|
+
// blow this up if x/y happen to be high-cardinality columns (an ID,
|
|
26
|
+
// a timestamp): up to 100*100 = 10,000 rect()+text() calls in one
|
|
27
|
+
// uninterrupted double loop, a genuine multi-second synchronous
|
|
28
|
+
// freeze confirmed in practice. Capped independently of any
|
|
29
|
+
// caller-side row limit, since THIS is what actually scales.
|
|
30
|
+
const MAX_HEATMAP_CATS = 50;
|
|
31
|
+
const xCatsAll = xLabels || [...new Set(data.map(d => d.x))];
|
|
32
|
+
const yCatsAll = yLabels || [...new Set(data.map(d => d.y))];
|
|
33
|
+
const xCats = xCatsAll.slice(0, MAX_HEATMAP_CATS);
|
|
34
|
+
const yCats = yCatsAll.slice(0, MAX_HEATMAP_CATS);
|
|
35
|
+
const catsTruncated = xCats.length < xCatsAll.length || yCats.length < yCatsAll.length;
|
|
36
|
+
const xCatSet = catsTruncated ? new Set(xCats) : null;
|
|
37
|
+
const yCatSet = catsTruncated ? new Set(yCats) : null;
|
|
38
|
+
const values = (catsTruncated ? data.filter(d => xCatSet.has(d.x) && yCatSet.has(d.y)) : data)
|
|
39
|
+
.map(d => d.value);
|
|
40
|
+
const vMin = Math.min(...values);
|
|
41
|
+
const vMax = Math.max(...values);
|
|
42
|
+
const cellW = width / xCats.length;
|
|
43
|
+
const cellH = height / yCats.length;
|
|
44
|
+
const textAnchor = this.renderer.centerTextAnchor;
|
|
45
|
+
|
|
46
|
+
if (title) this.renderer.text(title, x + width / 2, y - 30, { textAnchor: 'middle', fontSize: '18px', fill: '#333' });
|
|
47
|
+
|
|
48
|
+
const cellByKey = new Map(data.map(d => [`${d.x}|${d.y}`, d.value]));
|
|
49
|
+
yCats.forEach((yc, yi) => {
|
|
50
|
+
xCats.forEach((xc, xi) => {
|
|
51
|
+
const v = cellByKey.get(`${xc}|${yc}`);
|
|
52
|
+
const cellX = x + xi * cellW;
|
|
53
|
+
const cellY = y + yi * cellH;
|
|
54
|
+
const color = v == null ? '#eee' : ColorPalette.scaleColor(colorScale, vMin, vMax, v);
|
|
55
|
+
this.renderer.rect(cellX, cellY, Math.max(1, cellW - 1), Math.max(1, cellH - 1), color, null, {
|
|
56
|
+
tooltip: `${xc} / ${yc}: ${v ?? 'n/a'}`,
|
|
57
|
+
});
|
|
58
|
+
if (showValues && v != null) {
|
|
59
|
+
this.renderer.text(Axis.formatValue(v), cellX + cellW / 2, cellY + cellH / 2, {
|
|
60
|
+
textAnchor, verticalAlign: 'middle', fontSize: '10px', fill: ColorPalette.isDark(color) ? '#fff' : '#333',
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
xCats.forEach((xc, xi) => {
|
|
67
|
+
this.renderer.text(xc, x + xi * cellW + cellW / 2, y + height + 16, { textAnchor, fontSize: '10px' });
|
|
68
|
+
});
|
|
69
|
+
yCats.forEach((yc, yi) => {
|
|
70
|
+
this.renderer.text(yc, x - 8, y + yi * cellH + cellH / 2, { textAnchor: 'end', verticalAlign: 'middle', fontSize: '10px' });
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
if (catsTruncated) {
|
|
74
|
+
this.renderer.text(
|
|
75
|
+
`Showing ${xCats.length}×${yCats.length} of ${xCatsAll.length}×${yCatsAll.length} categories — pick lower-cardinality X/Y fields to see the rest`,
|
|
76
|
+
x + width / 2, y + height + 32, { textAnchor: 'middle', fontSize: '10px', fill: '#c0392b' },
|
|
77
|
+
);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { Chart } from '../Chart.js';
|
|
2
|
+
import { ColorPalette } from '../ColorPalette.js';
|
|
3
|
+
import { Axis } from '../Axis.js';
|
|
4
|
+
import { Hierarchy } from '../Hierarchy.js';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* HierarchyChart — abstract base for charts that render a hierarchy of nodes.
|
|
8
|
+
*
|
|
9
|
+
* Owns top-level palette assignment, per-depth color lightening, text-color
|
|
10
|
+
* contrast, and value formatting so subclasses stay focused on layout/rendering.
|
|
11
|
+
*/
|
|
12
|
+
export class HierarchyChart extends Chart {
|
|
13
|
+
_palette() {
|
|
14
|
+
if (!this._paletteInstance) {
|
|
15
|
+
this._paletteInstance = new ColorPalette(this.options.colors);
|
|
16
|
+
}
|
|
17
|
+
return this._paletteInstance;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
_topLevelColor() {
|
|
21
|
+
if (!this._topLevelColorMap) {
|
|
22
|
+
this._topLevelColorMap = new Map(this.data.map((n, i) => [n, this._palette().colorAt(i)]));
|
|
23
|
+
}
|
|
24
|
+
return this._topLevelColorMap;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
_colorForNode(topAncestor, depth) {
|
|
28
|
+
const baseColor = this._topLevelColor().get(topAncestor) ?? this._palette().colorAt(0);
|
|
29
|
+
return this._palette().lighten(baseColor, depth * 0.12);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
_textColorForNode(topAncestor, depth) {
|
|
33
|
+
return this._palette().isDark(this._colorForNode(topAncestor, depth)) ? '#fff' : '#222';
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
_formatNodeValue(node) {
|
|
37
|
+
return Axis.formatValue(Hierarchy.value(node));
|
|
38
|
+
}
|
|
39
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { Chart } from '../Chart.js';
|
|
2
|
+
import { ChartBox, ChartLabels } from '../ChartBox.js';
|
|
3
|
+
import { Axis } from '../Axis.js';
|
|
4
|
+
import { Statistics } from '../Statistics.js';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* HistogramChart — frequency distribution of a raw numeric sample, binned
|
|
8
|
+
* into `binCount` evenly-spaced buckets (default: a Sturges'-rule estimate,
|
|
9
|
+
* ⌈log2(n)+1⌉, clamped to a sane 5-20 range).
|
|
10
|
+
*/
|
|
11
|
+
export class HistogramChart extends Chart {
|
|
12
|
+
static chartType = 'histogram';
|
|
13
|
+
|
|
14
|
+
_render() {
|
|
15
|
+
const values = this.data;
|
|
16
|
+
const options = this.options;
|
|
17
|
+
const box = ChartBox.fromRenderer(this.renderer);
|
|
18
|
+
const {
|
|
19
|
+
x = box.x, y = box.y, width = box.width, height = box.height,
|
|
20
|
+
barColor = 'steelblue', title, xAxisLabel, yAxisLabel,
|
|
21
|
+
binCount = Math.min(20, Math.max(5, Math.ceil(Math.log2(values.length) + 1))),
|
|
22
|
+
} = options;
|
|
23
|
+
const bins = Statistics.histogramBins(values, binCount);
|
|
24
|
+
const maxCount = Math.max(...bins.map(b => b.count)) || 1;
|
|
25
|
+
const barWidth = width / bins.length;
|
|
26
|
+
const plotBox = { x, y, width, height };
|
|
27
|
+
|
|
28
|
+
new ChartLabels({ title, xAxisLabel, yAxisLabel }).draw(this.renderer, plotBox);
|
|
29
|
+
this.renderer.path(`M${x},${y} L${x},${y + height} L${x + width},${y + height}`, 'none', { color: 'black', width: 1 });
|
|
30
|
+
|
|
31
|
+
bins.forEach((bin, i) => {
|
|
32
|
+
const barHeight = (bin.count / maxCount) * height;
|
|
33
|
+
const barX = x + i * barWidth;
|
|
34
|
+
const barY = y + height - barHeight;
|
|
35
|
+
// No gap between bars (unlike barChart's categorical gaps) — bins
|
|
36
|
+
// are contiguous numeric ranges, not independent categories.
|
|
37
|
+
this.renderer.rect(barX, barY, Math.max(1, barWidth - 1), barHeight, barColor, null, {
|
|
38
|
+
tooltip: `${Axis.formatValue(bin.from)}–${Axis.formatValue(bin.to)}: ${bin.count}`,
|
|
39
|
+
});
|
|
40
|
+
if (i % Math.ceil(bins.length / 10 || 1) === 0) {
|
|
41
|
+
this.renderer.text(Axis.formatValue(bin.from), barX, y + height + 16, { textAnchor: 'start', fontSize: '9px' });
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { GaugeChart } from './GaugeChart.js';
|
|
2
|
+
import { Sparkline } from '../gauges/Sparkline.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* KpiTile — a key figure on a card: its title, its value large, the change
|
|
6
|
+
* since the previous value (▲ / ▼, coloured good or bad), and a sparkline of
|
|
7
|
+
* its history.
|
|
8
|
+
*
|
|
9
|
+
* Data: a number, or `{ value, previous?, history?, target? }` (`history` ends
|
|
10
|
+
* with the current value; without `previous` the one before it is used).
|
|
11
|
+
* Options: x, y, width, height (10, 10, 220, 120), format and units (a
|
|
12
|
+
* number with thousands grouped by default), change ('percent', or 'value'
|
|
13
|
+
* for the difference), upIsGood (true: up is green; false for costs, errors,
|
|
14
|
+
* ...), bands (the value takes its band's colour), sparkColor, background,
|
|
15
|
+
* and title.
|
|
16
|
+
*/
|
|
17
|
+
export class KpiTile extends GaugeChart {
|
|
18
|
+
static chartType = 'kpiTile';
|
|
19
|
+
static LAYOUT = { x: 10, y: 10, width: 220, height: 120 };
|
|
20
|
+
static GOOD = '#2e9e5b';
|
|
21
|
+
static BAD = '#d64545';
|
|
22
|
+
|
|
23
|
+
/** A figure reads as it is, its thousands grouped ("12,345"). */
|
|
24
|
+
defaultFormat() { return { grouping: true }; }
|
|
25
|
+
|
|
26
|
+
/** The value as it is: a tile has no range to hold it to. */
|
|
27
|
+
get value() { return this.gaugeValue.value; }
|
|
28
|
+
|
|
29
|
+
/** The value's colour: its band's when there are bands, else the text colour. */
|
|
30
|
+
valueColor(value = this.value) {
|
|
31
|
+
if (this.options.color != null || this.bands.length) return super.valueColor(value);
|
|
32
|
+
return '#2f3542';
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/** The change line: "▲ 10.0%" or "▼ 3", and whether it is good; null without a previous value. */
|
|
36
|
+
get changeText() {
|
|
37
|
+
const { change, changeRatio } = this.gaugeValue;
|
|
38
|
+
if (change == null) return null;
|
|
39
|
+
const { change: as = 'percent', upIsGood = true } = this.options;
|
|
40
|
+
const arrow = change > 0 ? '▲' : change < 0 ? '▼' : '■';
|
|
41
|
+
const amount = as === 'value' || changeRatio == null
|
|
42
|
+
? this.scale.label(Math.abs(change))
|
|
43
|
+
: `${(Math.abs(changeRatio) * 100).toFixed(1)}%`;
|
|
44
|
+
const good = change === 0 ? null : (change > 0) === upIsGood;
|
|
45
|
+
return { text: `${arrow} ${amount}`, good };
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
_render() {
|
|
49
|
+
const { x, y, width, height } = this.layout;
|
|
50
|
+
const { title, background = '#ffffff', sparkColor = '#5352ed' } = this.options;
|
|
51
|
+
const pad = 12;
|
|
52
|
+
this.renderer.rect(x, y, width, height, background, { color: '#e1e4e8', width: 1 }, { rx: 8, ry: 8 });
|
|
53
|
+
if (title) {
|
|
54
|
+
this.renderer.text(title, x + pad, y + pad + 6, { textAnchor: 'start', verticalAlign: 'middle', fontSize: '12px', fill: '#747d8c' });
|
|
55
|
+
}
|
|
56
|
+
const valueSize = Math.max(14, Math.round(height * 0.26));
|
|
57
|
+
const valueY = y + pad + 18 + valueSize / 2;
|
|
58
|
+
this.renderer.text(this.scale.label(this.value), x + pad, valueY, {
|
|
59
|
+
textAnchor: 'start', verticalAlign: 'middle', fontSize: `${valueSize}px`, fontWeight: 'bold', fill: this.valueColor(),
|
|
60
|
+
});
|
|
61
|
+
const change = this.changeText;
|
|
62
|
+
if (change) {
|
|
63
|
+
const color = change.good == null ? '#747d8c' : change.good ? KpiTile.GOOD : KpiTile.BAD;
|
|
64
|
+
this.renderer.text(change.text, x + width - pad, valueY, { textAnchor: 'end', verticalAlign: 'middle', fontSize: '12px', fontWeight: 'bold', fill: color });
|
|
65
|
+
}
|
|
66
|
+
const sparkTop = valueY + valueSize / 2 + 8;
|
|
67
|
+
const sparkHeight = y + height - pad - sparkTop;
|
|
68
|
+
if (sparkHeight > 4) {
|
|
69
|
+
new Sparkline(this.gaugeValue.history, { x: x + pad, y: sparkTop, width: width - 2 * pad, height: sparkHeight }).draw(this.renderer, { color: sparkColor });
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { ScatterChart } from './ScatterChart.js';
|
|
2
|
+
import { Statistics } from '../Statistics.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* LagPlotChart — value[t] against value[t-lag] (default lag=1), the standard
|
|
6
|
+
* visual autocorrelation check. Rendering delegates entirely to ScatterChart.
|
|
7
|
+
*/
|
|
8
|
+
export class LagPlotChart extends ScatterChart {
|
|
9
|
+
static chartType = 'lagPlot';
|
|
10
|
+
|
|
11
|
+
constructor(renderer, data, options = {}) {
|
|
12
|
+
super(renderer, data, options);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
_render() {
|
|
16
|
+
const options = this.options;
|
|
17
|
+
const lag = options.lag ?? 1;
|
|
18
|
+
const pairs = Statistics.lagPairs(this.data, lag);
|
|
19
|
+
if (!pairs.length) return;
|
|
20
|
+
|
|
21
|
+
const originalData = this.data;
|
|
22
|
+
const originalTitle = options.title;
|
|
23
|
+
const originalXAxisLabel = options.xAxisLabel;
|
|
24
|
+
const originalYAxisLabel = options.yAxisLabel;
|
|
25
|
+
const originalReferenceLine = options.referenceLine;
|
|
26
|
+
|
|
27
|
+
this.data = pairs.map((p, i) => ({ label: `t=${i + lag}`, x: p.x, y: p.y }));
|
|
28
|
+
options.title = originalTitle ?? 'Lag Plot';
|
|
29
|
+
options.xAxisLabel = originalXAxisLabel ?? `Value[t-${lag}]`;
|
|
30
|
+
options.yAxisLabel = originalYAxisLabel ?? 'Value[t]';
|
|
31
|
+
options.referenceLine = true;
|
|
32
|
+
|
|
33
|
+
super._render();
|
|
34
|
+
|
|
35
|
+
this.data = originalData;
|
|
36
|
+
options.title = originalTitle;
|
|
37
|
+
options.xAxisLabel = originalXAxisLabel;
|
|
38
|
+
options.yAxisLabel = originalYAxisLabel;
|
|
39
|
+
options.referenceLine = originalReferenceLine;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { Chart } from '../Chart.js';
|
|
2
|
+
import { ChartBox, ChartLabels } from '../ChartBox.js';
|
|
3
|
+
import { Legend } from '../Legend.js';
|
|
4
|
+
import { ColorPalette } from '../ColorPalette.js';
|
|
5
|
+
import { ErrorBars } from '../ErrorBars.js';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* LineChart — single or multi-series line chart with optional 3D ribbon
|
|
9
|
+
* effect and legend.
|
|
10
|
+
*/
|
|
11
|
+
export class LineChart extends Chart {
|
|
12
|
+
static chartType = 'line';
|
|
13
|
+
|
|
14
|
+
_render() {
|
|
15
|
+
const data = this.data;
|
|
16
|
+
const options = this.options;
|
|
17
|
+
const box = ChartBox.fromRenderer(this.renderer);
|
|
18
|
+
const {
|
|
19
|
+
x = box.x, y = box.y, width = box.width, height = box.height,
|
|
20
|
+
lineColor = 'steelblue', pointColor = '#fff', title, xAxisLabel, yAxisLabel,
|
|
21
|
+
colors, zAxis = false, legend: showLegend = false, depth: zDepth = 20,
|
|
22
|
+
} = options;
|
|
23
|
+
const plotBox = { x, y, width, height };
|
|
24
|
+
|
|
25
|
+
// Check if data is multiline (array of series) or single line
|
|
26
|
+
const isMultiline = Array.isArray(data[0]?.values);
|
|
27
|
+
const series = isMultiline ? data : [{ name: 'default', values: data }];
|
|
28
|
+
|
|
29
|
+
// Determine max value across all series
|
|
30
|
+
const maxValue = Math.max(...series.flatMap(s =>
|
|
31
|
+
isMultiline ? s.values.map(d => d.value) : s.values.map(d => d.value)
|
|
32
|
+
)) || 1;
|
|
33
|
+
|
|
34
|
+
const pointMargin = (isMultiline ? series[0].values.length : data.length) > 1
|
|
35
|
+
? width / ((isMultiline ? series[0].values.length : data.length) - 1)
|
|
36
|
+
: width;
|
|
37
|
+
|
|
38
|
+
const depth = zAxis ? zDepth : 0;
|
|
39
|
+
const lineColors = colors || ColorPalette.DEFAULT;
|
|
40
|
+
const palette = new ColorPalette(lineColors);
|
|
41
|
+
|
|
42
|
+
new ChartLabels({ title, xAxisLabel, yAxisLabel }).draw(this.renderer, plotBox);
|
|
43
|
+
|
|
44
|
+
// 3D Axes
|
|
45
|
+
const axisPath = zAxis
|
|
46
|
+
? `M${x + depth},${y - depth} L${x},${y} L${x},${y + height} L${x + width},${y + height} L${x + width + depth},${y + height - depth} M${x},${y + height} L${x + depth},${y + height - depth}`
|
|
47
|
+
: `M${x},${y} L${x},${y + height} L${x + width},${y + height}`;
|
|
48
|
+
|
|
49
|
+
this.renderer.path(axisPath, 'none', { color: 'black', width: 1 });
|
|
50
|
+
|
|
51
|
+
// Draw each series
|
|
52
|
+
series.forEach((seriesData, seriesIndex) => {
|
|
53
|
+
const seriesValues = isMultiline ? seriesData.values : seriesData.values;
|
|
54
|
+
const seriesColor = palette.colorAt(seriesIndex);
|
|
55
|
+
const seriesDepth = zAxis ? (depth / series.length) * (series.length - 1 - seriesIndex) : 0;
|
|
56
|
+
|
|
57
|
+
// Draw line
|
|
58
|
+
if (zAxis) {
|
|
59
|
+
// 3D effect: draw a "ribbon"
|
|
60
|
+
const ribbonPath = seriesValues.map((d, i) => {
|
|
61
|
+
const pY = y + height - (d.value / maxValue) * height;
|
|
62
|
+
return `L${x + i * pointMargin + seriesDepth},${pY - seriesDepth}`;
|
|
63
|
+
}).join(' ').replace('L', 'M');
|
|
64
|
+
this.renderer.path(ribbonPath, palette.lighten(seriesColor, -0.2), null);
|
|
65
|
+
}
|
|
66
|
+
let pathData = '';
|
|
67
|
+
seriesValues.forEach((d, i) => {
|
|
68
|
+
const pointX = x + i * pointMargin + seriesDepth;
|
|
69
|
+
const pointY = y + height - (d.value / maxValue) * height - seriesDepth;
|
|
70
|
+
if (i === 0) {
|
|
71
|
+
pathData += `M${pointX},${pointY}`;
|
|
72
|
+
} else {
|
|
73
|
+
pathData += ` L${pointX},${pointY}`;
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
this.renderer.path(pathData, 'none', { color: seriesColor, width: 2 });
|
|
77
|
+
|
|
78
|
+
// Draw points + optional error bars
|
|
79
|
+
seriesValues.forEach((d, i) => {
|
|
80
|
+
const pointX = x + i * pointMargin + seriesDepth;
|
|
81
|
+
const pointY = y + height - (d.value / maxValue) * height - seriesDepth;
|
|
82
|
+
const textAnchor = this.renderer.centerTextAnchor;
|
|
83
|
+
|
|
84
|
+
this.renderer.circle(
|
|
85
|
+
pointX, pointY,
|
|
86
|
+
3,
|
|
87
|
+
seriesColor,
|
|
88
|
+
{ color: pointColor, width: 1.5 },
|
|
89
|
+
{ tooltip: `${isMultiline ? seriesData.name + ': ' : ''}${d.label}: ${d.value}` }
|
|
90
|
+
);
|
|
91
|
+
|
|
92
|
+
const errMinus = d.errorMinus != null ? d.errorMinus : d.error != null ? d.error : null;
|
|
93
|
+
const errPlus = d.errorPlus != null ? d.errorPlus : d.error != null ? d.error : null;
|
|
94
|
+
if (errMinus != null || errPlus != null) {
|
|
95
|
+
const yHighVal = d.value + (errPlus ?? 0);
|
|
96
|
+
const yLowVal = d.value - (errMinus ?? 0);
|
|
97
|
+
const yHigh = y + height - (yHighVal / maxValue) * height - seriesDepth;
|
|
98
|
+
const yLow = y + height - (yLowVal / maxValue) * height - seriesDepth;
|
|
99
|
+
ErrorBars.draw(this.renderer, pointX, pointY, null, null, yLow, yHigh, seriesColor);
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
// Draw labels only for first series to avoid clutter. Use this
|
|
104
|
+
// series' own seriesDepth (not the raw max `depth`) for the x-shift
|
|
105
|
+
// so labels line up under series 0's actual (depth-shifted) points.
|
|
106
|
+
if (seriesIndex === 0) {
|
|
107
|
+
seriesValues.forEach((d, i) => {
|
|
108
|
+
const pointX = x + i * pointMargin + seriesDepth;
|
|
109
|
+
const textAnchor = this.renderer.centerTextAnchor;
|
|
110
|
+
this.renderer.text(d.label, pointX, y + height + 20, { textAnchor: textAnchor });
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
// Draw legend for multiline
|
|
116
|
+
if (isMultiline && showLegend) {
|
|
117
|
+
const legendItems = series.map((s, i) => ({ name: s.name, color: palette.colorAt(i) }));
|
|
118
|
+
new Legend({
|
|
119
|
+
items: legendItems, x: x + width + 20, y,
|
|
120
|
+
itemHeight: 20, markerSize: 12,
|
|
121
|
+
}).draw(this.renderer);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { GaugeChart } from './GaugeChart.js';
|
|
2
|
+
import { ArcTrack } from '../gauges/ArcTrack.js';
|
|
3
|
+
import { GaugeScale } from '../gauges/GaugeScale.js';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* MultiRingGauge — several values as rings one inside the other ("activity
|
|
7
|
+
* rings"), each filled to its value on its own scale, with a legend.
|
|
8
|
+
*
|
|
9
|
+
* Data: `[{ value, label?, color?, min?, max? }]` (or plain numbers), outer
|
|
10
|
+
* ring first; each ring's min and max default to the options'.
|
|
11
|
+
* Options: cx, cy, r (the outer ring: 100, 100, 70), thickness (12), gap (4),
|
|
12
|
+
* startAngle (-90) and sweep (360), colors (a colour per ring without its
|
|
13
|
+
* own), legend (true: each ring's label and value to the right), and the
|
|
14
|
+
* GaugeChart options min, max, format, units.
|
|
15
|
+
*/
|
|
16
|
+
export class MultiRingGauge extends GaugeChart {
|
|
17
|
+
static chartType = 'multiRingGauge';
|
|
18
|
+
static LAYOUT = { cx: 100, cy: 100, r: 70, thickness: 12, gap: 4, startAngle: -90, sweep: 360 };
|
|
19
|
+
static COLORS = ['#5352ed', '#2ed573', '#ffa502', '#ff4757', '#1e90ff'];
|
|
20
|
+
|
|
21
|
+
/** One per value: its track, scale and colour. */
|
|
22
|
+
get rings() {
|
|
23
|
+
const { cx, cy, r, thickness, gap, startAngle, sweep } = this.layout;
|
|
24
|
+
const { min, max, format, units, colors = MultiRingGauge.COLORS } = this.options;
|
|
25
|
+
return this.gaugeValue.values.map((v, i) => ({
|
|
26
|
+
...v,
|
|
27
|
+
track: new ArcTrack({ cx, cy, r: r - i * (thickness + gap), thickness, startAngle, sweep }),
|
|
28
|
+
scale: new GaugeScale({ min: v.min ?? min, max: v.max ?? max, format: format ?? null, units }),
|
|
29
|
+
color: v.color ?? colors[i % colors.length],
|
|
30
|
+
})).filter(ring => ring.track.r > ring.track.thickness / 2);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
_render() {
|
|
34
|
+
const { title, legend = true } = this.options;
|
|
35
|
+
const { cx, cy, r, thickness } = this.layout;
|
|
36
|
+
const rings = this.rings;
|
|
37
|
+
for (const ring of rings) {
|
|
38
|
+
this.drawBackground(ring.track);
|
|
39
|
+
this.drawValue(ring.track, { value: ring.scale.clamp(ring.value), scale: ring.scale, color: ring.color, cap: 'round' });
|
|
40
|
+
}
|
|
41
|
+
if (legend) {
|
|
42
|
+
const x = cx + r + thickness / 2 + 16;
|
|
43
|
+
const top = cy - ((rings.length - 1) * 18) / 2;
|
|
44
|
+
rings.forEach((ring, i) => {
|
|
45
|
+
const y = top + i * 18;
|
|
46
|
+
this.renderer.circle(x + 4, y, 4, ring.color);
|
|
47
|
+
this.renderer.text(`${ring.label ?? `#${i + 1}`} ${ring.scale.label(ring.scale.clamp(ring.value))}`, x + 14, y, {
|
|
48
|
+
textAnchor: 'start', verticalAlign: 'middle', fontSize: '12px', fill: '#2f3542',
|
|
49
|
+
});
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
this._renderTitle(title, cx, cy + r + thickness / 2 + 18, { textAnchor: 'middle', fontSize: '12px', fill: '#747d8c' });
|
|
53
|
+
}
|
|
54
|
+
}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { Axis } from '../Axis.js';
|
|
2
|
+
import { Hierarchy } from '../Hierarchy.js';
|
|
3
|
+
import { HierarchyChart } from './HierarchyChart.js';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* OutlineChart — an indented, collapsible tree list (file-explorer shape) for
|
|
7
|
+
* the same hierarchical composition a treemap/sunburst show spatially.
|
|
8
|
+
*/
|
|
9
|
+
export class OutlineChart extends HierarchyChart {
|
|
10
|
+
static chartType = 'outline';
|
|
11
|
+
|
|
12
|
+
constructor(renderer, data, options = {}, collapsed = null, onToggle = null) {
|
|
13
|
+
super(renderer, data, options);
|
|
14
|
+
this.collapsed = collapsed;
|
|
15
|
+
this.onToggle = onToggle;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
_render() {
|
|
19
|
+
const data = this.data;
|
|
20
|
+
const options = this.options;
|
|
21
|
+
const { title, onNodeClick, structuralKeys = OutlineChart.HIERARCHY_STRUCTURAL_KEYS } = options;
|
|
22
|
+
const ROW_H = OutlineChart.ROW_H;
|
|
23
|
+
const INDENT_W = OutlineChart.INDENT_W;
|
|
24
|
+
const width = this.renderer.width ?? 640;
|
|
25
|
+
const countX = Math.max(width - 50, 100);
|
|
26
|
+
const detailX = Math.max(width * 0.45, 260);
|
|
27
|
+
|
|
28
|
+
let y = 16;
|
|
29
|
+
if (title) { this.renderer.text(title, 12, 20, { fontSize: '16px', fill: '#333' }); y = 48; }
|
|
30
|
+
|
|
31
|
+
const rows = Hierarchy.outlineLayout(data, 0, this.collapsed || new Set());
|
|
32
|
+
rows.forEach(({ node, depth, hasChildren, topAncestor }) => {
|
|
33
|
+
const rowCenterY = y + ROW_H / 2;
|
|
34
|
+
const indentX = 12 + depth * INDENT_W;
|
|
35
|
+
const accentColor = this._colorForNode(topAncestor, depth);
|
|
36
|
+
|
|
37
|
+
const g = this.renderer.group();
|
|
38
|
+
g.appendChild(this.renderer.rect(indentX - 2, rowCenterY - 5, 10, 10, accentColor, null));
|
|
39
|
+
|
|
40
|
+
let labelX = indentX + 16;
|
|
41
|
+
if (hasChildren) {
|
|
42
|
+
const collapsedHere = this.collapsed ? this.collapsed.has(node) : false;
|
|
43
|
+
const badgeX = indentX + 26;
|
|
44
|
+
const badge = this.renderer.circle(badgeX, rowCenterY, 7, '#ffffff', { color: '#888', width: 1.2 });
|
|
45
|
+
g.appendChild(badge);
|
|
46
|
+
g.appendChild(this.renderer.text(collapsedHere ? '+' : '−', badgeX, rowCenterY, {
|
|
47
|
+
textAnchor: 'middle', verticalAlign: 'middle', fontSize: '10px', fill: '#555', 'pointer-events': 'none',
|
|
48
|
+
}));
|
|
49
|
+
badge.style.cursor = 'pointer';
|
|
50
|
+
badge.addEventListener('click', (event) => {
|
|
51
|
+
event.stopPropagation();
|
|
52
|
+
if (this.collapsed) {
|
|
53
|
+
this.collapsed.has(node) ? this.collapsed.delete(node) : this.collapsed.add(node);
|
|
54
|
+
}
|
|
55
|
+
if (this.onToggle) this.onToggle();
|
|
56
|
+
});
|
|
57
|
+
labelX = badgeX + 16;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
g.appendChild(this.renderer.text(node.label, labelX, rowCenterY, {
|
|
61
|
+
textAnchor: 'start', verticalAlign: 'middle', fontSize: '12px', fill: '#222',
|
|
62
|
+
}));
|
|
63
|
+
|
|
64
|
+
if (hasChildren) {
|
|
65
|
+
g.appendChild(this.renderer.text(this._formatNodeValue(node), countX, rowCenterY, {
|
|
66
|
+
textAnchor: 'end', verticalAlign: 'middle', fontSize: '11px', fill: '#888', 'pointer-events': 'none',
|
|
67
|
+
}));
|
|
68
|
+
} else if (Number.isFinite(node.value)) {
|
|
69
|
+
g.appendChild(this.renderer.text(Axis.formatValue(node.value), countX, rowCenterY, {
|
|
70
|
+
textAnchor: 'end', verticalAlign: 'middle', fontSize: '11px', fill: '#888', 'pointer-events': 'none',
|
|
71
|
+
}));
|
|
72
|
+
} else {
|
|
73
|
+
const extra = Hierarchy.outlineExtraText(node, structuralKeys);
|
|
74
|
+
if (extra) {
|
|
75
|
+
g.appendChild(this.renderer.text(extra, detailX, rowCenterY, {
|
|
76
|
+
textAnchor: 'start', verticalAlign: 'middle', fontSize: '11px', fill: '#888', 'pointer-events': 'none',
|
|
77
|
+
}));
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
if (onNodeClick) g.addEventListener('click', () => onNodeClick(node));
|
|
82
|
+
y += ROW_H;
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
const totalHeight = y + 12;
|
|
86
|
+
if (this.renderer.svg && totalHeight > this.renderer.height) {
|
|
87
|
+
this.renderer.svg.setAttribute('viewBox', `0 0 ${width} ${totalHeight}`);
|
|
88
|
+
this.renderer.svg.setAttribute('preserveAspectRatio', 'xMinYMin meet');
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
OutlineChart.ROW_H = 22;
|
|
94
|
+
OutlineChart.INDENT_W = 18;
|
|
95
|
+
OutlineChart.HIERARCHY_STRUCTURAL_KEYS = new Set(['label', 'value', 'children']);
|