Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions examples/browser-app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,18 @@

import "reflect-metadata";

import runCircleGraph from "./circlegraph/src/standalone";
import runClassDiagram from "./classdiagram/src/standalone";
import runRandomGraph from "./random-graph/src/standalone";
import runRandomGraphDistributed from "./random-graph-distributed/src/standalone";
import runSvgPreRendered from "./svg/src/standalone";
import runMulticore from "./multicore/src/multicore";
import runFlowchart from "./flowchart/src/standalone";
import runJsxample from "./jsxample/src/standalone";
import runStylingShowcase from "./styling-showcase/src/standalone";
import runMicroLayoutShowcase from "./micro-layout-showcase/src/standalone";
import runCustomViewsShowcase from "./custom-views-showcase/src/standalone";
import runLayoutStrategiesShowcase from "./layout-strategies-showcase/src/standalone";
import runCircleGraph from "./circlegraph/src/standalone.js";
import runClassDiagram from "./classdiagram/src/standalone.js";
import runRandomGraph from "./random-graph/src/standalone.js";
import runRandomGraphDistributed from "./random-graph-distributed/src/standalone.js";
import runSvgPreRendered from "./svg/src/standalone.js";
import runMulticore from "./multicore/src/multicore.js";
import runFlowchart from "./flowchart/src/standalone.js";
import runJsxample from "./jsxample/src/standalone.js";
import runStylingShowcase from "./styling-showcase/src/standalone.js";
import runMicroLayoutShowcase from "./micro-layout-showcase/src/standalone.js";
import runCustomViewsShowcase from "./custom-views-showcase/src/standalone.js";
import runLayoutStrategiesShowcase from "./layout-strategies-showcase/src/standalone.js";

const appDiv = document.getElementById('sprotty-app');
if (appDiv) {
Expand Down
2 changes: 1 addition & 1 deletion examples/circlegraph/src/di.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import {
PolylineEdgeView, MouseListener, SModelElementImpl
} from 'sprotty';
import { Action, Point } from 'sprotty-protocol';
import { CircleNodeView } from './views';
import { CircleNodeView } from './views.js';

const NodeCreator = Symbol('NodeCreator');

Expand Down
2 changes: 1 addition & 1 deletion examples/circlegraph/src/standalone.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import {
TYPES, IActionDispatcher, ElementMove, LocalModelSource
} from 'sprotty';
import { Bounds, Point, SEdge, SelectAction, SGraph, SNode, getBasicType, MoveAction } from 'sprotty-protocol';
import createContainer from './di.config';
import createContainer from './di.config.js';

const NODE_SIZE = 60;

Expand Down
3 changes: 1 addition & 2 deletions examples/circlegraph/src/views.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,9 @@
********************************************************************************/

/** @jsx svg */
import { svg } from 'sprotty/lib/lib/jsx';
import { injectable } from 'inversify';
import { VNode } from 'snabbdom';
import { RenderingContext, SNodeImpl, ShapeView } from 'sprotty';
import { RenderingContext, SNodeImpl, ShapeView, svg } from 'sprotty';

/**
* A very simple example node consisting of a plain circle.
Expand Down
56 changes: 42 additions & 14 deletions examples/classdiagram/src/di.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,49 @@
import '@vscode/codicons/dist/codicon.css';
import { Container, ContainerModule } from 'inversify';
import {
TYPES, configureViewerOptions, SGraphView, SLabelView, SCompartmentView, JumpingPolylineEdgeView,
ConsoleLogger, LogLevel, loadDefaultModules, HtmlRootView, PreRenderedView, ExpandButtonView,
SRoutingHandleView, PreRenderedElementImpl, HtmlRootImpl, SGraphImpl, configureModelElement, SLabelImpl,
SCompartmentImpl, SEdgeImpl, SButtonImpl, SRoutingHandleImpl, RevealNamedElementActionProvider,
CenterGridSnapper, expandFeature, nameFeature, withEditLabelFeature, editLabelFeature,
RectangularNode, BezierCurveEdgeView, SBezierCreateHandleView, SBezierControlHandleView, moveFeature, selectFeature
BezierCurveEdgeView,
Comment thread
gfontorbe marked this conversation as resolved.
BezierMouseListener,
CenterGridSnapper,
ConsoleLogger,
ExpandButtonView,
HtmlRootImpl,
HtmlRootView,
JumpingPolylineEdgeView,
LogLevel,
PreRenderedElementImpl,
PreRenderedView,
RectangularNode,
RevealNamedElementActionProvider,
SBezierControlHandleView,
SBezierCreateHandleView,
SButtonImpl,
SCompartmentImpl,
SCompartmentView,
SEdgeImpl,
SGraphImpl,
SGraphView,
SLabelImpl,
SLabelView,
SRoutingHandleImpl,
SRoutingHandleView,
TYPES,
configureModelElement,
configureViewerOptions,
edgeIntersectionModule,
editLabelFeature,
expandFeature,
loadDefaultModules,
moveFeature,
nameFeature,
selectFeature,
withEditLabelFeature
} from 'sprotty';
import edgeIntersectionModule from 'sprotty/lib/features/edge-intersection/di.config';
import { BezierMouseListener } from 'sprotty/lib/features/routing/bezier-edge-router';
import { ClassDiagramLabelValidationDecorator, ClassDiagramLabelValidator } from './label-validation';
import { ClassContextMenuItemProvider, ClassContextMenuService } from './menu';
import { ClassLabel, ClassNode, Icon, PropertyLabel } from './model';
import { ClassDiagramModelSource } from './model-source';
import { PopupModelProvider } from './popup';
import { IconView, NodeView } from './views';
import { ClassDiagramLabelValidationDecorator, ClassDiagramLabelValidator } from './label-validation.js';
import { ClassContextMenuItemProvider, ClassContextMenuService } from './menu.js';
import { ClassLabel, ClassNode, Icon, PropertyLabel } from './model.js';
import { ClassDiagramModelSource } from './model-source.js';
import { PopupModelProvider } from './popup.js';
import { IconView, NodeView } from './views.js';

export default (containerId: string) => {
require('sprotty/css/sprotty.css');
Expand Down
2 changes: 1 addition & 1 deletion examples/classdiagram/src/popup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import {
TYPES, IModelFactory, IPopupModelProvider
} from 'sprotty';
import { PreRenderedElement, RequestPopupModelAction, SModelElement, SModelRoot } from 'sprotty-protocol';
import { ClassNode } from './model';
import { ClassNode } from './model.js';

@injectable()
export class PopupModelProvider implements IPopupModelProvider {
Expand Down
2 changes: 1 addition & 1 deletion examples/classdiagram/src/standalone.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
********************************************************************************/

import createContainer from './di.config';
import createContainer from './di.config.js';
import { TYPES, LocalModelSource } from 'sprotty';

export default function runClassDiagram() {
Expand Down
8 changes: 3 additions & 5 deletions examples/classdiagram/src/views.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,10 @@
********************************************************************************/

/** @jsx svg */
import { svg } from 'sprotty/lib/lib/jsx';

import { RenderingContext, IView, RectangularNodeView, SNodeImpl, IViewArgs } from 'sprotty';
import { VNode } from 'snabbdom';
import { Icon } from './model';
import { injectable } from 'inversify';
import { VNode } from 'snabbdom';
import { IView, IViewArgs, RectangularNodeView, RenderingContext, SNodeImpl, svg } from 'sprotty';
import { Icon } from './model.js';

@injectable()
export class NodeView extends RectangularNodeView {
Expand Down
4 changes: 2 additions & 2 deletions examples/custom-views-showcase/src/di.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ import {
import {
BasicShapeNode, EnhancedNode, ComplexNode, StatefulNode,
StyledEdge, CustomLabel
} from './model';
} from './model.js';

// Import our custom view classes
import {
BasicShapeView, EnhancedNodeView, ComplexNodeView, StatefulNodeView,
StyledEdgeView, CustomLabelView
} from './views';
} from './views.js';

export default () => {
require('sprotty/css/sprotty.css');
Expand Down
2 changes: 1 addition & 1 deletion examples/custom-views-showcase/src/standalone.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

import { TYPES, LocalModelSource, IActionDispatcher } from 'sprotty';
import { SGraph, SNode, SEdge, SLabel, FitToScreenAction } from 'sprotty-protocol';
import createContainer from './di.config';
import createContainer from './di.config.js';

export default async function runCustomViewsShowcase() {
console.log('Starting Custom Views Showcase...');
Expand Down
5 changes: 2 additions & 3 deletions examples/custom-views-showcase/src/views.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,10 @@
********************************************************************************/

/** @jsx svg */
import { svg } from 'sprotty';
import { injectable } from 'inversify';
import { VNode } from 'snabbdom';
import { IView, RenderingContext, IViewArgs, RectangularNodeView, PolylineEdgeView } from 'sprotty';
import { BasicShapeNode, EnhancedNode, ComplexNode, StatefulNode, StyledEdge, CustomLabel } from './model';
import { IView, IViewArgs, PolylineEdgeView, RectangularNodeView, RenderingContext, svg } from 'sprotty';
import { BasicShapeNode, ComplexNode, CustomLabel, EnhancedNode, StatefulNode, StyledEdge } from './model.js';

/**
* Basic Shape View - demonstrates simple custom view creation
Expand Down
4 changes: 2 additions & 2 deletions examples/flowchart/src/standalone.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@

import { LocalModelSource, TYPES } from 'sprotty';
import { BringToFrontAction, FitToScreenAction } from 'sprotty-protocol';
import createContainer from './di.config';
import { initializeModel } from './data';
import createContainer from './di.config.js';
import { initializeModel } from './data.js';

export default async function runFlowchart() {
const container = createContainer('sprotty');
Expand Down
2 changes: 1 addition & 1 deletion examples/jsxample/src/di.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import {
configureModelElement,
configureViewerOptions,
loadDefaultModules} from "sprotty";
import { ExampleNodeView } from "./views";
import { ExampleNodeView } from "./views.js";

export default (containerId: string) => {
require('../css/diagram.css');
Expand Down
2 changes: 1 addition & 1 deletion examples/jsxample/src/standalone.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
********************************************************************************/

import { LocalModelSource, TYPES } from 'sprotty';
import createContainer from './di.config';
import createContainer from './di.config.js';

export default async function runJsxample() {
const container = createContainer('sprotty');
Expand Down
4 changes: 1 addition & 3 deletions examples/jsxample/src/views.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,9 @@
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
********************************************************************************/
/** @jsx svg */
import { SLabelImpl, svg } from 'sprotty';

import { injectable } from "inversify";
import { VNode } from "snabbdom";
import { IViewArgs, RenderingContext, SShapeElementImpl, ShapeView } from "sprotty";
import { IViewArgs, RenderingContext, SLabelImpl, SShapeElementImpl, ShapeView, svg } from 'sprotty';

@injectable()
export class ExampleNodeView extends ShapeView {
Expand Down
12 changes: 6 additions & 6 deletions examples/layout-strategies-showcase/src/di.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,25 +41,25 @@
ElkFactory,
ElkLayoutEngine,
ILayoutConfigurator
} from 'sprotty-elk/lib/inversify';
import { LayoutOptions } from 'elkjs/lib/elk-api';
} from 'sprotty-elk';
import { LayoutOptions } from 'elkjs';
import { SGraph, SModelIndex, SNode } from 'sprotty-protocol';
import ElkConstructor from 'elkjs/lib/elk.bundled';
import ElkConstructor from 'elkjs/lib/elk.bundled.js';
import {
ServerLayoutNode,
LayoutEdge
} from './model';
} from './model.js';
import {
ClientLayoutNodeView,
ServerLayoutNodeView,
HybridLayoutNodeView,
LayoutEdgeView
} from './views';
} from './views.js';

/**
* ELK factory for creating ELK layout instances
*/
const elkFactory: ElkFactory = () => new ElkConstructor({
const elkFactory: ElkFactory = () => new ElkConstructor.default({
algorithms: ['layered']
});

Expand Down Expand Up @@ -154,13 +154,13 @@
// Layout engine configuration
bind(ElkFactory).toConstantValue(elkFactory);
bind(ILayoutConfigurator).to(ServerLayoutConfigurator);
bind(TYPES.IModelLayoutEngine).toDynamicValue((context) => (

Check warning on line 157 in examples/layout-strategies-showcase/src/di.config.ts

View workflow job for this annotation

GitHub Actions / Sprotty CI

'context' is already declared in the upper scope on line 149 column 11
new ElkLayoutEngine(
context.container.get(ElkFactory), // elk factory
undefined, // filter
context.container.get(ILayoutConfigurator), // layout configurator
undefined, // layout preprocessor
undefined, // layout postprocessor

Check warning on line 163 in examples/layout-strategies-showcase/src/di.config.ts

View workflow job for this annotation

GitHub Actions / Sprotty CI

Unexpected trailing comma
)
)).inSingletonScope();

Expand Down Expand Up @@ -193,13 +193,13 @@
// Layout engine configuration
bind(ElkFactory).toConstantValue(elkFactory);
bind(ILayoutConfigurator).to(HybridLayoutConfigurator);
bind(TYPES.IModelLayoutEngine).toDynamicValue((context) => (

Check warning on line 196 in examples/layout-strategies-showcase/src/di.config.ts

View workflow job for this annotation

GitHub Actions / Sprotty CI

'context' is already declared in the upper scope on line 188 column 11
new ElkLayoutEngine(
context.container.get(ElkFactory), // elk factory
undefined, // filter
context.container.get(ILayoutConfigurator), // layout configurator
undefined, // layout preprocessor
undefined, // layout postprocessor

Check warning on line 202 in examples/layout-strategies-showcase/src/di.config.ts

View workflow job for this annotation

GitHub Actions / Sprotty CI

Unexpected trailing comma
)
)).inSingletonScope();

Expand Down
6 changes: 3 additions & 3 deletions examples/layout-strategies-showcase/src/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export class ClientLayoutNode extends SNodeImpl {

// Layout configuration
override layout: string = 'vbox';
override layoutOptions?: {
declare layoutOptions?: {
paddingTop?: number;
paddingBottom?: number;
paddingLeft?: number;
Expand Down Expand Up @@ -75,7 +75,7 @@ export class ServerLayoutNode extends SNodeImpl {
nodeType?: 'service' | 'database' | 'client' | 'router' | 'gateway';

// Layout constraints for server algorithms
override layoutOptions?: {
declare layoutOptions?: {
'elk.portConstraints'?: string;
'elk.nodeLabels.placement'?: string;
'elk.priority'?: number;
Expand All @@ -101,7 +101,7 @@ export class HybridLayoutNode extends SNodeImpl {

// Client layout for internal content
override layout: string = 'vbox';
override layoutOptions?: {
declare layoutOptions?: {
paddingTop?: number;
paddingBottom?: number;
paddingLeft?: number;
Expand Down
2 changes: 1 addition & 1 deletion examples/layout-strategies-showcase/src/standalone.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

import { TYPES, LocalModelSource } from 'sprotty';
import { SGraph, SNode, SEdge, SLabel, SCompartment, FitToScreenAction } from 'sprotty-protocol';
import { createLayoutContainer } from './di.config';
import { createLayoutContainer } from './di.config.js';
// Global variables for the demo
let currentContainer: any;
let currentModelSource: LocalModelSource;
Expand Down
2 changes: 1 addition & 1 deletion examples/layout-strategies-showcase/src/views.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { IView, RenderingContext, IViewArgs, PolylineEdgeView, ShapeView } from
import {
ServerLayoutNode,
LayoutEdge
} from './model';
} from './model.js';

/**
* Client Layout Node View - Rich content with micro-layout
Expand Down
4 changes: 2 additions & 2 deletions examples/micro-layout-showcase/src/di.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ import {
layoutableChildFeature,
loadDefaultModules
} from 'sprotty';
import { InteractiveCardNode } from './model';
import { ComponentView, DemoCardView, InteractiveCardView } from './views';
import { InteractiveCardNode } from './model.js';
import { ComponentView, DemoCardView, InteractiveCardView } from './views.js';

export default () => {
require('sprotty/css/sprotty.css');
Expand Down
2 changes: 1 addition & 1 deletion examples/micro-layout-showcase/src/standalone.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

import { TYPES, LocalModelSource, IActionDispatcher } from 'sprotty';
import { SGraph, SNode, SLabel, SCompartment, FitToScreenAction } from 'sprotty-protocol';
import createContainer from './di.config';
import createContainer from './di.config.js';

export default async function runMicroLayoutShowcase() {
const container = createContainer();
Expand Down Expand Up @@ -478,7 +478,7 @@
if (input) {
input.addEventListener('input', (e) => {
const target = e.target as HTMLInputElement;
const value = parseInt(target.value);

Check warning on line 481 in examples/micro-layout-showcase/src/standalone.ts

View workflow job for this annotation

GitHub Actions / Sprotty CI

Missing radix parameter
updateInteractiveCard(modelSource, { [property]: value });
});
}
Expand All @@ -490,7 +490,7 @@
if (input) {
input.addEventListener('input', (e) => {
const target = e.target as HTMLInputElement;
const value = parseInt(target.value);

Check warning on line 493 in examples/micro-layout-showcase/src/standalone.ts

View workflow job for this annotation

GitHub Actions / Sprotty CI

Missing radix parameter
updateInteractiveCard(modelSource, { [property]: value });
});
}
Expand Down
4 changes: 2 additions & 2 deletions examples/micro-layout-showcase/src/views.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
********************************************************************************/

/** @jsx svg */
import { svg } from 'sprotty/lib/lib/jsx';
import { svg } from 'sprotty';
import { injectable } from 'inversify';
import { VNode } from 'snabbdom';
import { RenderingContext, ShapeView } from 'sprotty';
import { InteractiveCardNode } from './model';
import { InteractiveCardNode } from './model.js';

/**
* Custom view for the interactive card that shows layout effects.
Expand Down
4 changes: 2 additions & 2 deletions examples/multicore/src/di.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ import {
loadDefaultModules, LocalModelSource, HtmlRootView, PreRenderedView, SvgExporter,
configureModelElement, PreRenderedElementImpl, HtmlRootImpl, SLabelImpl, SCompartmentImpl
} from 'sprotty';
import { ProcessorView, CoreView, CrossbarView, ChannelView, SimpleCoreView } from './views';
import { Channel, Core, Crossbar, Processor } from './chipmodel';
import { ProcessorView, CoreView, CrossbarView, ChannelView, SimpleCoreView } from './views.js';
import { Channel, Core, Crossbar, Processor } from './chipmodel.js';

class FilteringSvgExporter extends SvgExporter {
isExported(styleSheet: CSSStyleSheet): boolean {
Expand Down
4 changes: 2 additions & 2 deletions examples/multicore/src/multicore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ import {
CORE_DISTANCE,
CORE_WIDTH,
ChannelSchema, CoreSchema, CrossbarSchema, Direction, ProcessorSchema
} from './chipmodel';
import createContainer from './di.config';
} from './chipmodel.js';
import createContainer from './di.config.js';

export default function runMulticore() {
const container = createContainer();
Expand Down
8 changes: 3 additions & 5 deletions examples/multicore/src/views.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,10 @@
********************************************************************************/

/** @jsx svg */
import { svg } from 'sprotty/lib/lib/jsx';

import { VNode } from "snabbdom";
import { IView, RenderingContext, setAttr, ThunkView, RGBColor, toSVG, rgb, ShapeView, IViewArgs } from 'sprotty';
import { CORE_DISTANCE, CORE_WIDTH, Channel, Core, Crossbar, Direction, Processor } from './chipmodel';
import { injectable } from 'inversify';
import { VNode } from "snabbdom";
import { IView, IViewArgs, RenderingContext, rgb, RGBColor, setAttr, ShapeView, svg, ThunkView, toSVG } from 'sprotty';
import { Channel, Core, CORE_DISTANCE, CORE_WIDTH, Crossbar, Direction, Processor } from './chipmodel.js';

@injectable()
export class ProcessorView implements IView {
Expand Down
Loading
Loading