@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,31 @@
|
|
|
1
|
+
/** Command to rename a folder */
|
|
2
|
+
export class RenameFolderCommand {
|
|
3
|
+
constructor(folderId, oldName, newName, { diagram = null, onRename = null } = {}) {
|
|
4
|
+
this.folderId = folderId;
|
|
5
|
+
this.oldName = oldName;
|
|
6
|
+
this.newName = newName;
|
|
7
|
+
this.diagram = diagram;
|
|
8
|
+
this.onRename = onRename;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
execute() {
|
|
12
|
+
if (this.diagram?.engine?.getArchimateModel) {
|
|
13
|
+
const model = this.diagram.engine.getArchimateModel?.();
|
|
14
|
+
const folder = model?.getFolder?.(this.folderId);
|
|
15
|
+
if (folder) {
|
|
16
|
+
folder.name = this.newName;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
this.onRename?.(this.folderId, this.newName);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
undo() {
|
|
23
|
+
if (this.diagram?.engine?.getArchimateModel) {
|
|
24
|
+
const model = this.diagram.engine.getArchimateModel?.();
|
|
25
|
+
const folder = model?.getFolder?.(this.folderId);
|
|
26
|
+
if (folder) {
|
|
27
|
+
folder.name = this.oldName;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Command } from '../../CommandHistory.js';
|
|
2
|
+
|
|
3
|
+
export class RenameNodeCommand extends Command {
|
|
4
|
+
constructor(nodeId, from, to, { diagram, label = 'Rename node', onRename } = {}) {
|
|
5
|
+
super(label);
|
|
6
|
+
this.nodeId = nodeId;
|
|
7
|
+
this.from = from;
|
|
8
|
+
this.to = to;
|
|
9
|
+
this._diagram = diagram;
|
|
10
|
+
this._onRename = onRename;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
execute() { this._apply(this.to); }
|
|
14
|
+
undo() { this._apply(this.from); }
|
|
15
|
+
|
|
16
|
+
_apply(name) {
|
|
17
|
+
const node = this._findNode();
|
|
18
|
+
if (!node) return;
|
|
19
|
+
node.label = name;
|
|
20
|
+
this._diagram?._rerenderGraph?.();
|
|
21
|
+
this._onRename?.(node, name);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
_findNode() {
|
|
25
|
+
return this._diagram?._chartState?.nodes?.find(n => n.id === this.nodeId);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { GraphCommand } from './GraphCommand.js';
|
|
2
|
+
|
|
3
|
+
/** What a resize can change: a box's width/height, or a round shape's radius. */
|
|
4
|
+
export const NODE_SIZE_KEYS = ['width', 'height', 'radius'];
|
|
5
|
+
|
|
6
|
+
/** A node's size, every key present (undefined = not set, the node's default). */
|
|
7
|
+
export function nodeSize(node) {
|
|
8
|
+
return Object.fromEntries(NODE_SIZE_KEYS.map(key => [key, node?.[key]]));
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* ResizeNodeCommand — sets a node's size (`from`/`to` as from `nodeSize()`;
|
|
13
|
+
* an undefined key is removed, putting the node back on its default) and
|
|
14
|
+
* coalesces with the previous resize of the same node. Every apply, including
|
|
15
|
+
* undo and redo, reports the node through `onNodeResize(node)`.
|
|
16
|
+
*/
|
|
17
|
+
export class ResizeNodeCommand extends GraphCommand {
|
|
18
|
+
constructor(nodeId, from, to, { diagram, label = 'Resize node' } = {}) {
|
|
19
|
+
super(label, diagram);
|
|
20
|
+
this.nodeId = nodeId;
|
|
21
|
+
this.from = { ...from };
|
|
22
|
+
this.to = { ...to };
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
execute() { this._apply(this.to); }
|
|
26
|
+
undo() { this._apply(this.from); }
|
|
27
|
+
|
|
28
|
+
_apply(size) {
|
|
29
|
+
const node = this._node(this.nodeId);
|
|
30
|
+
if (!node) return;
|
|
31
|
+
for (const key of NODE_SIZE_KEYS) {
|
|
32
|
+
if (!(key in size)) continue;
|
|
33
|
+
if (size[key] == null) delete node[key];
|
|
34
|
+
else node[key] = size[key];
|
|
35
|
+
}
|
|
36
|
+
this._redraw();
|
|
37
|
+
this.options.onNodeResize?.(node);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
merge(other) {
|
|
41
|
+
if (other instanceof ResizeNodeCommand && other.nodeId === this.nodeId) {
|
|
42
|
+
return new ResizeNodeCommand(this.nodeId, this.from, other.to, { diagram: this._diagram, label: this.label });
|
|
43
|
+
}
|
|
44
|
+
return undefined;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { EdgeCommand } from './GraphCommand.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* UpdateEdgeSideCommand — pins the side of a node one end of an edge attaches
|
|
5
|
+
* to. Every apply, including undo and redo, reports it through
|
|
6
|
+
* `onEdgeSideChange(edge, endpoint, side)` (endpoint 'source'|'target').
|
|
7
|
+
*/
|
|
8
|
+
export class UpdateEdgeSideCommand extends EdgeCommand {
|
|
9
|
+
/**
|
|
10
|
+
* @param {Object} edge
|
|
11
|
+
* @param {'source'|'target'} endpointType
|
|
12
|
+
* @param {string} newSide
|
|
13
|
+
* @param {Object} [options]
|
|
14
|
+
* @param {string} [options.oldSide] - The side before the edit, `undefined` for automatic
|
|
15
|
+
* (default when omitted: the edge's side now)
|
|
16
|
+
*/
|
|
17
|
+
constructor(edge, endpointType, newSide, options = {}) {
|
|
18
|
+
const { diagram, label = 'Update edge side' } = options;
|
|
19
|
+
super(label, edge, diagram);
|
|
20
|
+
this._endpointType = endpointType; // 'source' or 'target'
|
|
21
|
+
this._newSide = newSide;
|
|
22
|
+
this._oldSide = 'oldSide' in options ? options.oldSide : (endpointType === 'source' ? edge.sourceSide : edge.targetSide);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
execute() {
|
|
26
|
+
this._apply(this._newSide);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
undo() {
|
|
30
|
+
this._apply(this._oldSide);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
_apply(side) {
|
|
34
|
+
const edge = this.edge;
|
|
35
|
+
if (!edge) return;
|
|
36
|
+
edge[this._endpointType === 'source' ? 'sourceSide' : 'targetSide'] = side;
|
|
37
|
+
this._redraw();
|
|
38
|
+
this.options.onEdgeSideChange?.(edge, this._endpointType, side);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export { AddEdgeCommand } from './AddEdgeCommand.js';
|
|
2
|
+
export { AddNodeCommand } from './AddNodeCommand.js';
|
|
3
|
+
export { AddWaypointCommand } from './AddWaypointCommand.js';
|
|
4
|
+
export { CreateFolderCommand } from './CreateFolderCommand.js';
|
|
5
|
+
export { DeleteEdgeCommand } from './DeleteEdgeCommand.js';
|
|
6
|
+
export { DeleteFolderCommand } from './DeleteFolderCommand.js';
|
|
7
|
+
export { DeleteNodeCommand } from './DeleteNodeCommand.js';
|
|
8
|
+
export { DeleteWaypointCommand } from './DeleteWaypointCommand.js';
|
|
9
|
+
export { InvertEdgeCommand } from './InvertEdgeCommand.js';
|
|
10
|
+
export { MoveNodeCommand } from './MoveNodeCommand.js';
|
|
11
|
+
export { MoveWaypointCommand } from './MoveWaypointCommand.js';
|
|
12
|
+
export { RenameEdgeCommand } from './RenameEdgeCommand.js';
|
|
13
|
+
export { RenameFolderCommand } from './RenameFolderCommand.js';
|
|
14
|
+
export { RenameNodeCommand } from './RenameNodeCommand.js';
|
|
15
|
+
export { ResizeNodeCommand, NODE_SIZE_KEYS, nodeSize } from './ResizeNodeCommand.js';
|
|
16
|
+
export { GraphCommand, EdgeCommand, WaypointCommand } from './GraphCommand.js';
|
|
17
|
+
export { UpdateEdgeSideCommand } from './UpdateEdgeSideCommand.js';
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* When two elements are probably one thing twice: one definition for the
|
|
3
|
+
* model check (likely duplicates) and whatever offers to merge them.
|
|
4
|
+
*
|
|
5
|
+
* Names are compared by their words, ignoring case, punctuation, word order
|
|
6
|
+
* and filler words ("of", "and", "the", ...): "Order Management System",
|
|
7
|
+
* "order-management system" and "System of Order Management" match. A name
|
|
8
|
+
* that is only filler is compared as it is.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
/** Words that do not tell two names apart. */
|
|
12
|
+
export const FILLER_WORDS = Object.freeze(['a', 'an', 'and', 'the', 'of', 'on', 'for', 'to', 'in', 'at', 'by', 'with', '&']);
|
|
13
|
+
|
|
14
|
+
/** The words a name is compared by, as one key ('' for no name). */
|
|
15
|
+
export function nameKey(name) {
|
|
16
|
+
const words = String(name ?? '').toLowerCase().replace(/[^\p{L}\p{N}&]+/gu, ' ').trim().split(/\s+/).filter(Boolean);
|
|
17
|
+
const meaningful = words.filter(w => !FILLER_WORDS.includes(w));
|
|
18
|
+
return [...new Set(meaningful.length ? meaningful : words)].sort().join(' ');
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* The elements that are probably the same thing twice: groups of two or more
|
|
23
|
+
* of one type whose names have the same key.
|
|
24
|
+
* @param {Array<Object>} elements
|
|
25
|
+
* @returns {Array<Array<Object>>}
|
|
26
|
+
*/
|
|
27
|
+
export function duplicateGroups(elements) {
|
|
28
|
+
const groups = new Map();
|
|
29
|
+
for (const e of elements) {
|
|
30
|
+
const key = nameKey(e.name);
|
|
31
|
+
if (!key) continue;
|
|
32
|
+
const k = `${e.type} ${key}`;
|
|
33
|
+
if (!groups.has(k)) groups.set(k, []);
|
|
34
|
+
groups.get(k).push(e);
|
|
35
|
+
}
|
|
36
|
+
return [...groups.values()].filter(g => g.length > 1);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/** A character class of these code-point ranges (written as numbers: such characters cannot sit in the source). */
|
|
40
|
+
const charClass = (ranges, flags = '') => {
|
|
41
|
+
const escape = (code) => '\\u' + code.toString(16).padStart(4, '0');
|
|
42
|
+
return new RegExp('[' + ranges.map(([a, b = a]) => `${escape(a)}-${escape(b)}`).join('') + ']', flags);
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
/** Characters that should not be in a name (any control character) or documentation (one but tab and line breaks); zero-width spaces in either. */
|
|
46
|
+
export const UNPRINTABLE = Object.freeze({
|
|
47
|
+
name: charClass([[0x00, 0x1f], [0x7f, 0x9f], [0x200b, 0x200f], [0x2028, 0x2029], [0xfeff]]),
|
|
48
|
+
documentation: charClass([[0x00, 0x08], [0x0b, 0x0c], [0x0e, 0x1f], [0x7f, 0x9f], [0x200b, 0x200f], [0xfeff]]),
|
|
49
|
+
});
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { ViewObjectInstance } from './ViewObjectInstance.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Nesting: an element's box drawn inside another element's on a view (Archi's
|
|
5
|
+
* nested elements), which stands for a relationship from the parent to the
|
|
6
|
+
* child. One definition for the editor (what it offers when you nest) and the
|
|
7
|
+
* model check (nested elements with no such relationship).
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
/** What nesting one element in another can stand for, in the order offered (Archi's defaults). */
|
|
11
|
+
export const NESTING_KINDS = Object.freeze(['composition', 'aggregation', 'assignment', 'realization', 'specialization']);
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Each element box drawn inside another element's on a view.
|
|
15
|
+
* @param {ArchimateView} view
|
|
16
|
+
* @returns {Array<{view, parentElementId: string, childElementId: string, childInstanceId: string}>}
|
|
17
|
+
*/
|
|
18
|
+
export function viewNestings(view) {
|
|
19
|
+
const instances = [...(view.elementInstances?.values() ?? [])].filter(i => !(i instanceof ViewObjectInstance));
|
|
20
|
+
const byVisualId = new Map(instances.map(i => [i.visualId, i]));
|
|
21
|
+
return instances
|
|
22
|
+
.map(child => [child, byVisualId.get(child.nestedIn)])
|
|
23
|
+
.filter(([child, parent]) => parent && parent !== child)
|
|
24
|
+
.map(([child, parent]) => ({ view, parentElementId: parent.elementId, childElementId: child.elementId, childInstanceId: child.id }));
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/** The model's relationships a nesting can stand for, from `parentId` to `childId`. */
|
|
28
|
+
export function nestingRelationships(model, parentId, childId) {
|
|
29
|
+
return model.relationships().filter(r => r.source === parentId && r.target === childId && NESTING_KINDS.includes(r.kind));
|
|
30
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Roadmaps: elements with a start and an end date drawn as bars on a time
|
|
3
|
+
* line of months (as the roadMap jArchi script draws them), work packages,
|
|
4
|
+
* plateaus, projects and anything else with dates. Pure: where things go;
|
|
5
|
+
* ArchimateModel#generateRoadmap makes the view.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
const MONTHS = {
|
|
9
|
+
short: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
|
|
10
|
+
full: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* A date written in a property: ISO (2026-03-31, 2026-03), or day/month/year
|
|
15
|
+
* (31/03/2026, 31.3.2026). Null when it is not a date.
|
|
16
|
+
* @returns {Date|null} at midnight UTC
|
|
17
|
+
*/
|
|
18
|
+
export function parseDate(text) {
|
|
19
|
+
const s = String(text ?? '').trim();
|
|
20
|
+
let m = s.match(/^(\d{4})-(\d{1,2})(?:-(\d{1,2}))?/);
|
|
21
|
+
if (m) return valid(+m[1], +m[2], +(m[3] ?? 1));
|
|
22
|
+
m = s.match(/^(\d{1,2})[/.](\d{1,2})[/.](\d{4})$/);
|
|
23
|
+
if (m) return valid(+m[3], +m[2], +m[1]);
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function valid(year, month, day) {
|
|
28
|
+
const d = new Date(Date.UTC(year, month - 1, day));
|
|
29
|
+
return d.getUTCFullYear() === year && d.getUTCMonth() === month - 1 && d.getUTCDate() === day ? d : null;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Where each part of a roadmap goes.
|
|
34
|
+
* @param {Array<{id: string, start: Date, end: Date}>} items
|
|
35
|
+
* @param {Object} [options]
|
|
36
|
+
* @param {number} [options.monthWidth] - A month's width
|
|
37
|
+
* @param {number} [options.barHeight]
|
|
38
|
+
* @param {number} [options.gap] - Between lanes
|
|
39
|
+
* @param {'short'|'full'} [options.monthNames]
|
|
40
|
+
* @param {{x: number, y: number}} [options.at] - The top-left corner
|
|
41
|
+
* @returns {{years: Array, months: Array, bars: Array<{id, x, y, width, height, lane}>, height: number}}
|
|
42
|
+
* every part a box `{x, y, width, height}` (top-left), years and months with a `label`
|
|
43
|
+
*/
|
|
44
|
+
export function roadmapPlan(items, { monthWidth = 60, barHeight = 24, gap = 6, monthNames = 'short', at = { x: 20, y: 20 } } = {}) {
|
|
45
|
+
const dated = items.filter(i => i.start && i.end && i.end >= i.start);
|
|
46
|
+
if (!dated.length) return { years: [], months: [], bars: [], height: 0 };
|
|
47
|
+
const first = new Date(Math.min(...dated.map(i => i.start)));
|
|
48
|
+
const last = new Date(Math.max(...dated.map(i => i.end)));
|
|
49
|
+
const startYear = first.getUTCFullYear(), startMonth = first.getUTCMonth();
|
|
50
|
+
const monthCount = (last.getUTCFullYear() - startYear) * 12 + last.getUTCMonth() - startMonth + 1;
|
|
51
|
+
const headerHeight = 24;
|
|
52
|
+
const xOf = (date) => {
|
|
53
|
+
const months = (date.getUTCFullYear() - startYear) * 12 + date.getUTCMonth() - startMonth;
|
|
54
|
+
const days = new Date(Date.UTC(date.getUTCFullYear(), date.getUTCMonth() + 1, 0)).getUTCDate();
|
|
55
|
+
return at.x + (months + (date.getUTCDate() - 1) / days) * monthWidth;
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
const months = [], years = [];
|
|
59
|
+
for (let i = 0; i < monthCount; i++) {
|
|
60
|
+
const year = startYear + Math.floor((startMonth + i) / 12), month = (startMonth + i) % 12;
|
|
61
|
+
months.push({ label: MONTHS[monthNames][month], x: at.x + i * monthWidth, y: at.y + headerHeight, width: monthWidth, height: headerHeight });
|
|
62
|
+
const y = years.at(-1);
|
|
63
|
+
if (y?.label === String(year)) y.width += monthWidth;
|
|
64
|
+
else years.push({ label: String(year), x: at.x + i * monthWidth, y: at.y, width: monthWidth, height: headerHeight });
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
// Earliest first (the longer first when they start together), each in the first lane free by its start.
|
|
68
|
+
const lanes = [];
|
|
69
|
+
const bars = [...dated].sort((a, b) => a.start - b.start || b.end - a.end).map(item => {
|
|
70
|
+
let lane = lanes.findIndex(end => end < item.start);
|
|
71
|
+
if (lane < 0) { lane = lanes.length; lanes.push(item.end); } else lanes[lane] = item.end;
|
|
72
|
+
const x = xOf(item.start);
|
|
73
|
+
const endX = xOf(new Date(item.end.getTime() + 86400000)); // through the end day
|
|
74
|
+
return { id: item.id, lane, x, y: at.y + 2 * headerHeight + gap + lane * (barHeight + gap), width: Math.max(8, endX - x), height: barHeight };
|
|
75
|
+
});
|
|
76
|
+
return { years, months, bars, height: 2 * headerHeight + gap + lanes.length * (barHeight + gap) };
|
|
77
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { EdgeMarker } from './EdgeMarker.js';
|
|
2
|
+
|
|
3
|
+
/** ArrowMarker — filled arrowhead; navigable association / flow direction. */
|
|
4
|
+
export class ArrowMarker extends EdgeMarker {
|
|
5
|
+
static key = 'arrow';
|
|
6
|
+
static label = 'Arrow';
|
|
7
|
+
|
|
8
|
+
shapes(tip, dir, size, color) {
|
|
9
|
+
const at = (back, side) => EdgeMarker.at(tip, dir, back, side);
|
|
10
|
+
return [{
|
|
11
|
+
tag: 'polygon',
|
|
12
|
+
attrs: { points: EdgeMarker.points([tip, at(size * 1.25, size * 0.55), at(size * 1.25, -size * 0.55)]), fill: color },
|
|
13
|
+
}];
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { EdgeMarker } from './EdgeMarker.js';
|
|
2
|
+
|
|
3
|
+
/** CircleMarker — filled dot touching the node. */
|
|
4
|
+
export class CircleMarker extends EdgeMarker {
|
|
5
|
+
static key = 'circle';
|
|
6
|
+
static label = 'Circle';
|
|
7
|
+
|
|
8
|
+
shapes(tip, dir, size, color) {
|
|
9
|
+
const r = size / 2;
|
|
10
|
+
const c = EdgeMarker.at(tip, dir, r);
|
|
11
|
+
return [{ tag: 'circle', attrs: { cx: c.x, cy: c.y, r, fill: color } }];
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { EdgeMarker } from './EdgeMarker.js';
|
|
2
|
+
|
|
3
|
+
/** CrowsFootMarker — ER "many": three prongs fanning out from the edge to the node. */
|
|
4
|
+
export class CrowsFootMarker extends EdgeMarker {
|
|
5
|
+
static key = 'crowsfoot';
|
|
6
|
+
static label = "Crow's Foot";
|
|
7
|
+
|
|
8
|
+
shapes(tip, dir, size, color) {
|
|
9
|
+
const vertex = EdgeMarker.at(tip, dir, size * 1.5);
|
|
10
|
+
const feet = [tip, EdgeMarker.at(tip, dir, 0, size * 0.8), EdgeMarker.at(tip, dir, 0, -size * 0.8)];
|
|
11
|
+
return feet.map(foot => ({
|
|
12
|
+
tag: 'line',
|
|
13
|
+
attrs: { x1: vertex.x, y1: vertex.y, x2: foot.x, y2: foot.y, stroke: color, 'stroke-width': 1.5 },
|
|
14
|
+
}));
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { EdgeMarker } from './EdgeMarker.js';
|
|
2
|
+
|
|
3
|
+
/** DiamondMarker — filled diamond (UML composition) with its point on the node. */
|
|
4
|
+
export class DiamondMarker extends EdgeMarker {
|
|
5
|
+
static key = 'diamond';
|
|
6
|
+
static label = 'Diamond';
|
|
7
|
+
|
|
8
|
+
shapes(tip, dir, size, color) {
|
|
9
|
+
const at = (back, side) => EdgeMarker.at(tip, dir, back, side);
|
|
10
|
+
return [{
|
|
11
|
+
tag: 'polygon',
|
|
12
|
+
attrs: { points: EdgeMarker.points([tip, at(size, size * 0.5), at(size * 2, 0), at(size, -size * 0.5)]), fill: color },
|
|
13
|
+
}];
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* EdgeMarker — glyph drawn where an edge meets a node (arrowhead, crow's foot, ...).
|
|
3
|
+
*
|
|
4
|
+
* Geometry is pure: shapes() returns element descriptors with the glyph's tip
|
|
5
|
+
* ON the node boundary and its body extending back along the edge, so no part
|
|
6
|
+
* of it is hidden under the node. `dir` is the unit direction in which the
|
|
7
|
+
* edge travels into the node at that end.
|
|
8
|
+
*/
|
|
9
|
+
export class EdgeMarker {
|
|
10
|
+
/** Stored value on an edge (`edge.startMarker` / `edge.endMarker`). */
|
|
11
|
+
static key = null;
|
|
12
|
+
/** Display name for pickers. */
|
|
13
|
+
static label = null;
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* @param {{x: number, y: number}} tip - Where the edge meets the node
|
|
17
|
+
* @param {{x: number, y: number}} dir - Unit direction of travel into the node
|
|
18
|
+
* @param {number} size - Nominal glyph size in canvas units
|
|
19
|
+
* @param {string} color
|
|
20
|
+
* @returns {Array<{tag: string, attrs: Object}>}
|
|
21
|
+
*/
|
|
22
|
+
shapes(tip, dir, size, color) {
|
|
23
|
+
throw new Error(`${this.constructor.name} must implement shapes()`);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/** Point `back` units behind the tip along the edge, offset `side` units to its left. */
|
|
27
|
+
static at(tip, dir, back, side = 0) {
|
|
28
|
+
return { x: tip.x - dir.x * back - dir.y * side, y: tip.y - dir.y * back + dir.x * side };
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
static points(pts) {
|
|
32
|
+
return pts.map(p => `${p.x},${p.y}`).join(' ');
|
|
33
|
+
}
|
|
34
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { OpenArrowMarker } from './OpenArrowMarker.js';
|
|
2
|
+
|
|
3
|
+
/** HalfArrowMarker — a single barb at the node (ArchiMate's directed association). */
|
|
4
|
+
export class HalfArrowMarker extends OpenArrowMarker {
|
|
5
|
+
static key = 'openarrowhalf';
|
|
6
|
+
static label = 'Half arrow';
|
|
7
|
+
static sides = [1];
|
|
8
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { EdgeMarker } from './EdgeMarker.js';
|
|
2
|
+
|
|
3
|
+
/** HollowDiamondMarker — outlined diamond (aggregation) with its point on the node. */
|
|
4
|
+
export class HollowDiamondMarker extends EdgeMarker {
|
|
5
|
+
static key = 'diamondhollow';
|
|
6
|
+
static label = 'Hollow diamond';
|
|
7
|
+
|
|
8
|
+
shapes(tip, dir, size, color, background = '#ffffff') {
|
|
9
|
+
const at = (back, side) => EdgeMarker.at(tip, dir, back, side);
|
|
10
|
+
return [{
|
|
11
|
+
tag: 'polygon',
|
|
12
|
+
attrs: {
|
|
13
|
+
points: EdgeMarker.points([tip, at(size, size * 0.5), at(size * 2, 0), at(size, -size * 0.5)]),
|
|
14
|
+
fill: background, stroke: color, 'stroke-width': 1.5,
|
|
15
|
+
},
|
|
16
|
+
}];
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { EdgeMarker } from './EdgeMarker.js';
|
|
2
|
+
|
|
3
|
+
/** HollowTriangleMarker — outlined triangle (realization, specialization) with its point on the node. */
|
|
4
|
+
export class HollowTriangleMarker extends EdgeMarker {
|
|
5
|
+
static key = 'trianglehollow';
|
|
6
|
+
static label = 'Hollow triangle';
|
|
7
|
+
|
|
8
|
+
shapes(tip, dir, size, color, background = '#ffffff') {
|
|
9
|
+
const at = (back, side) => EdgeMarker.at(tip, dir, back, side);
|
|
10
|
+
return [{
|
|
11
|
+
tag: 'polygon',
|
|
12
|
+
attrs: {
|
|
13
|
+
points: EdgeMarker.points([tip, at(size * 1.5, size * 0.75), at(size * 1.5, -size * 0.75)]),
|
|
14
|
+
fill: background, stroke: color, 'stroke-width': 1.5,
|
|
15
|
+
},
|
|
16
|
+
}];
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { EdgeMarker } from './EdgeMarker.js';
|
|
2
|
+
|
|
3
|
+
/** OpenArrowMarker — two strokes meeting at the node (serving, access, influence). */
|
|
4
|
+
export class OpenArrowMarker extends EdgeMarker {
|
|
5
|
+
static key = 'openarrow';
|
|
6
|
+
static label = 'Open arrow';
|
|
7
|
+
|
|
8
|
+
/** Sides the barbs sit on: both. */
|
|
9
|
+
static sides = [1, -1];
|
|
10
|
+
|
|
11
|
+
shapes(tip, dir, size, color) {
|
|
12
|
+
return this.constructor.sides.map(side => {
|
|
13
|
+
const barb = EdgeMarker.at(tip, dir, size * 1.25, side * size * 0.6);
|
|
14
|
+
return { tag: 'line', attrs: { x1: tip.x, y1: tip.y, x2: barb.x, y2: barb.y, stroke: color, 'stroke-width': 1.5 } };
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { ArrowMarker } from './ArrowMarker.js';
|
|
2
|
+
import { DiamondMarker } from './DiamondMarker.js';
|
|
3
|
+
import { CircleMarker } from './CircleMarker.js';
|
|
4
|
+
import { CrowsFootMarker } from './CrowsFootMarker.js';
|
|
5
|
+
import { HollowDiamondMarker } from './HollowDiamondMarker.js';
|
|
6
|
+
import { HollowTriangleMarker } from './HollowTriangleMarker.js';
|
|
7
|
+
import { OpenArrowMarker } from './OpenArrowMarker.js';
|
|
8
|
+
import { HalfArrowMarker } from './HalfArrowMarker.js';
|
|
9
|
+
|
|
10
|
+
export { EdgeMarker } from './EdgeMarker.js';
|
|
11
|
+
export { ArrowMarker, DiamondMarker, CircleMarker, CrowsFootMarker, HollowDiamondMarker, HollowTriangleMarker, OpenArrowMarker, HalfArrowMarker };
|
|
12
|
+
|
|
13
|
+
/** Marker instances in picker order. */
|
|
14
|
+
export const EDGE_MARKERS = [
|
|
15
|
+
new ArrowMarker(), new OpenArrowMarker(), new HalfArrowMarker(), new HollowTriangleMarker(),
|
|
16
|
+
new DiamondMarker(), new HollowDiamondMarker(), new CircleMarker(), new CrowsFootMarker(),
|
|
17
|
+
];
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Marker for a stored `edge.startMarker` / `edge.endMarker` value, or null for
|
|
21
|
+
* none/unknown. Case and punctuation are ignored, so "Crow's Foot",
|
|
22
|
+
* "crows foot" and "crowsfoot" all resolve to the same marker.
|
|
23
|
+
*/
|
|
24
|
+
export function getEdgeMarker(value) {
|
|
25
|
+
const key = String(value ?? '').toLowerCase().replace(/[^a-z]/g, '');
|
|
26
|
+
return EDGE_MARKERS.find(m => m.constructor.key === key) ?? null;
|
|
27
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { SettingsCascade } from '../SettingsCascade.js';
|
|
2
|
+
import { EDGE_STYLE_PROPERTIES } from './EdgeStyleSchema.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* EdgeStyleCascade — a SettingsCascade over the line-style schema, where the
|
|
6
|
+
* line itself is always the first (most specific) level.
|
|
7
|
+
*/
|
|
8
|
+
export class EdgeStyleCascade extends SettingsCascade {
|
|
9
|
+
constructor(levels = [], properties = EDGE_STYLE_PROPERTIES) {
|
|
10
|
+
super(levels, properties);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/** Effective style for a line, plus where each value came from. */
|
|
14
|
+
resolve(edge) {
|
|
15
|
+
return this.resolveWith({ key: 'line', label: 'This line', style: edge ?? {} });
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/** What a level inherits; 'line' means a line with no overrides of its own. */
|
|
19
|
+
inheritedBy(levelKey) {
|
|
20
|
+
return super.inheritedBy(levelKey === 'line' ? null : levelKey);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { FormDialog } from '../FormDialog.js';
|
|
2
|
+
import { inheritableFields } from '../SettingsCascade.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* EdgeStyleDialog — edit one style holder: a single line, or a level's defaults
|
|
6
|
+
* (diagram, model, tool). A FormDialog whose fields come from the schema;
|
|
7
|
+
* cascading fields offer "Inherit", labelled with the value and the level it
|
|
8
|
+
* would come from.
|
|
9
|
+
*/
|
|
10
|
+
export class EdgeStyleDialog {
|
|
11
|
+
/**
|
|
12
|
+
* @param {Object} options
|
|
13
|
+
* @param {string} options.title
|
|
14
|
+
* @param {Object} options.target - Current values (unset keys inherit)
|
|
15
|
+
* @param {ReadonlyArray<Object>} options.properties - Cascading schema properties
|
|
16
|
+
* @param {{style: Object, sources: Object}} options.inherited - What unset values resolve to
|
|
17
|
+
* @param {ReadonlyArray<Object>} [options.fixedProperties] - Non-cascading properties (line only)
|
|
18
|
+
* @param {Array<Object>} [options.extraFields] - More FormDialog fields after those (e.g. what the line stands for);
|
|
19
|
+
* their values come to onApply too
|
|
20
|
+
* @param {(patch: Object) => void} options.onApply - Receives every shown key; undefined = inherit
|
|
21
|
+
* @param {Document} [options.document]
|
|
22
|
+
*/
|
|
23
|
+
constructor({ title, target, properties, inherited, fixedProperties = [], extraFields = [], onApply, document: doc }) {
|
|
24
|
+
const fixed = fixedProperties.map(p => ({ ...p, value: target[p.key] ?? p.default }));
|
|
25
|
+
const cascading = inheritableFields(properties, target, inherited);
|
|
26
|
+
this.dialog = new FormDialog({
|
|
27
|
+
title,
|
|
28
|
+
fields: [...fixed, ...extraFields, ...(extraFields.length ? [{ type: 'heading', label: 'Line style' }] : []), ...cascading],
|
|
29
|
+
idPrefix: 'edge-style-',
|
|
30
|
+
document: doc,
|
|
31
|
+
onApply: (values) => {
|
|
32
|
+
// A line-only field left at its default is stored as unset.
|
|
33
|
+
for (const p of fixedProperties) if (values[p.key] === p.default) values[p.key] = undefined;
|
|
34
|
+
onApply(values);
|
|
35
|
+
},
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
open() {
|
|
40
|
+
this.dialog.open();
|
|
41
|
+
return this;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
close() {
|
|
45
|
+
this.dialog.close();
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
get overlay() {
|
|
49
|
+
return this.dialog.overlay;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* EdgeStyleSchema — the line properties that cascade (line → diagram → model →
|
|
3
|
+
* tool → built-in default), and the line-only properties that do not.
|
|
4
|
+
*
|
|
5
|
+
* Pure data: the cascade, the property dialogs and Edge#clone all read these
|
|
6
|
+
* lists, so adding a property here is the whole change. Vocabulary matches
|
|
7
|
+
* GraphDiagram/ArchiMate (`routing`, `lineStyle`, marker names).
|
|
8
|
+
*/
|
|
9
|
+
import { EDGE_MARKERS } from '../edgeMarkers/index.js';
|
|
10
|
+
|
|
11
|
+
/** Dash pattern per `lineStyle`; shared with GraphDiagram so both draw identically. */
|
|
12
|
+
export const LINE_STYLE_DASH = Object.freeze({ solid: null, dashed: '5 4', dotted: '1.5 3' });
|
|
13
|
+
|
|
14
|
+
const MARKER_CHOICES = [['none', 'None'], ...EDGE_MARKERS.map(m => [m.constructor.key, m.constructor.label])];
|
|
15
|
+
|
|
16
|
+
/** Cascading properties: unset (undefined) on a level means "inherit". */
|
|
17
|
+
export const EDGE_STYLE_PROPERTIES = Object.freeze([
|
|
18
|
+
{
|
|
19
|
+
key: 'routing', label: 'Routing', type: 'select', default: 'straight',
|
|
20
|
+
choices: [['straight', 'Straight'], ['orthogonal', 'Orthogonal'], ['curved', 'Curved'], ['polyline', 'Around shapes']],
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
key: 'attach', label: 'Attach to', type: 'select', default: 'floating',
|
|
24
|
+
choices: [['floating', 'Outline, aimed at the other end'], ['sides', 'Middle of the facing side']],
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
key: 'lineStyle', label: 'Line', type: 'select', default: 'solid',
|
|
28
|
+
choices: [['solid', 'Solid'], ['dashed', 'Dashed'], ['dotted', 'Dotted']],
|
|
29
|
+
},
|
|
30
|
+
{ key: 'strokeColor', label: 'Colour', type: 'color', default: '#666666' },
|
|
31
|
+
{ key: 'strokeWidth', label: 'Width', type: 'number', default: 2, min: 1, max: 10 },
|
|
32
|
+
{ key: 'startMarker', label: 'Start', type: 'select', default: 'none', choices: MARKER_CHOICES },
|
|
33
|
+
{ key: 'endMarker', label: 'End', type: 'select', default: 'none', choices: MARKER_CHOICES },
|
|
34
|
+
]);
|
|
35
|
+
|
|
36
|
+
const SIDE_CHOICES = [['auto', 'Automatic'], ['top', 'Top'], ['right', 'Right'], ['bottom', 'Bottom'], ['left', 'Left']];
|
|
37
|
+
|
|
38
|
+
/** Properties that only make sense on one particular line. */
|
|
39
|
+
export const LINE_ONLY_PROPERTIES = Object.freeze([
|
|
40
|
+
{ key: 'label', label: 'Label', type: 'text', default: '' },
|
|
41
|
+
{ key: 'sourceSide', label: 'Start side', type: 'select', default: 'auto', choices: SIDE_CHOICES },
|
|
42
|
+
{ key: 'targetSide', label: 'End side', type: 'select', default: 'auto', choices: SIDE_CHOICES },
|
|
43
|
+
]);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { SetPropertiesCommand } from '../DiagramEditorCommands.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* SetStyleCommand — a SetPropertiesCommand on a style holder (a line, or a
|
|
5
|
+
* level's style object). An `undefined` value removes the key, which in a
|
|
6
|
+
* cascade means "inherit".
|
|
7
|
+
*/
|
|
8
|
+
export class SetStyleCommand extends SetPropertiesCommand {
|
|
9
|
+
constructor(target, patch, label = 'Change line style') {
|
|
10
|
+
super(target, patch, label);
|
|
11
|
+
}
|
|
12
|
+
}
|