@sentropic/diagram-canvas 0.3.1 → 0.4.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/README.md +23 -2
- package/dist/camera.d.ts +28 -9
- package/dist/camera.js +34 -13
- package/dist/index.d.ts +4 -0
- package/dist/index.js +4 -0
- package/dist/layout/cache.js +12 -2
- package/dist/layout/channels.d.ts +10 -0
- package/dist/layout/channels.js +13 -0
- package/dist/layout/conventions.d.ts +117 -0
- package/dist/layout/conventions.js +185 -0
- package/dist/layout/dock.d.ts +2 -0
- package/dist/layout/dock.js +5 -1
- package/dist/layout/fingerprint.d.ts +4 -2
- package/dist/layout/fingerprint.js +26 -2
- package/dist/layout/hints.d.ts +1 -1
- package/dist/layout/hints.js +10 -3
- package/dist/layout/index.d.ts +5 -3
- package/dist/layout/index.js +5 -3
- package/dist/layout/labels.d.ts +2 -0
- package/dist/layout/labels.js +2 -0
- package/dist/layout/measure.d.ts +6 -0
- package/dist/layout/measure.js +28 -0
- package/dist/layout/measured.js +1051 -100
- package/dist/layout/route.d.ts +27 -1
- package/dist/layout/route.js +640 -32
- package/dist/layout/routeSpacing.d.ts +84 -0
- package/dist/layout/routeSpacing.js +472 -0
- package/dist/layout/spacing.generated.d.ts +10 -1
- package/dist/layout/spacing.generated.js +10 -1
- package/dist/layout/types.d.ts +33 -2
- package/dist/layout/types.js +2 -0
- package/dist/presentation/connectorPath.d.ts +32 -0
- package/dist/presentation/connectorPath.js +213 -0
- package/dist/presentation/connectorStyle.d.ts +70 -0
- package/dist/presentation/connectorStyle.js +99 -0
- package/dist/presentation/diagramCardModel.d.ts +1 -1
- package/dist/presentation/diagramCardModel.js +1 -1
- package/dist/presentation/diagramSceneModel.d.ts +58 -7
- package/dist/presentation/diagramSceneModel.js +225 -35
- package/dist/presentation/diagramSceneTypes.d.ts +9 -0
- package/dist/presentation/index.d.ts +4 -0
- package/dist/presentation/index.js +4 -0
- package/dist/presentation/linkLegend.d.ts +132 -0
- package/dist/presentation/linkLegend.js +231 -0
- package/dist/presentation/renderSceneSvg.d.ts +3 -1
- package/dist/presentation/renderSceneSvg.js +81 -11
- package/dist/presentation/sceneLabelClearance.d.ts +1 -1
- package/dist/presentation/sceneLabelClearance.js +19 -3
- package/dist/r7Mode.d.ts +13 -0
- package/dist/r7Mode.js +67 -0
- package/dist/visibility.d.ts +1 -1
- package/dist/visibility.js +3 -2
- package/package.json +2 -2
package/dist/visibility.js
CHANGED
|
@@ -114,7 +114,7 @@ function combine(verdicts) {
|
|
|
114
114
|
}
|
|
115
115
|
/** The filters of one kind, in the view's own order, which is content here (an array, not a record). */
|
|
116
116
|
function filtersOfKind(view, kind) {
|
|
117
|
-
return view.filters.filter((filter) => filter.kind === kind);
|
|
117
|
+
return (view.filters ?? []).filter((filter) => filter.kind === kind);
|
|
118
118
|
}
|
|
119
119
|
export function entityVerdict(view, entity) {
|
|
120
120
|
return combine([
|
|
@@ -123,8 +123,9 @@ export function entityVerdict(view, entity) {
|
|
|
123
123
|
]);
|
|
124
124
|
}
|
|
125
125
|
export function relationVerdict(view, relation, document) {
|
|
126
|
+
const definition = document?.typeDefinitions?.[relation.type];
|
|
126
127
|
return combine([
|
|
127
|
-
verdictFor(filtersOfKind(view, "relation-type"), (filter) => filter.kind === "relation-type" ? filter.types.includes(relation.type) || (
|
|
128
|
+
verdictFor(filtersOfKind(view, "relation-type"), (filter) => filter.kind === "relation-type" ? filter.types.includes(relation.type) || (definition?.profile === relation.profile && filter.types.includes(definition.baseType)) : false),
|
|
128
129
|
verdictFor(filtersOfKind(view, "attribute-equals"), (filter) => filter.kind === "attribute-equals"
|
|
129
130
|
? attributeMatches(relation.attributes, filter.attribute, filter.value)
|
|
130
131
|
: false),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sentropic/diagram-canvas",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "Headless diagram scenes, layout, hit testing and pure presentation models/SVG helpers. No DOM or framework.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"main": "./dist/index.js",
|
|
59
59
|
"sideEffects": false,
|
|
60
60
|
"dependencies": {
|
|
61
|
-
"@sentropic/diagram-core": "0.
|
|
61
|
+
"@sentropic/diagram-core": "0.5.0"
|
|
62
62
|
},
|
|
63
63
|
"scripts": {
|
|
64
64
|
"build": "node ../../scripts/sync-diagram-spacing.mjs && tsc -p tsconfig.json",
|