@liquidcars/atlas-layout 0.1.7 → 0.1.8
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 +15 -0
- package/package.json +1 -1
- package/spec/ATLAS-LAYOUT-SPEC-v1.md +5 -2
- package/src/index.js +1 -0
- package/src/spec.js +11 -1
package/README.md
CHANGED
|
@@ -49,6 +49,21 @@ como alias de compatibilidad. Un contenedor puede no tener geometría o usar una
|
|
|
49
49
|
primitiva `geo.*`; las geometrías personalizadas de los packs, como `infra.cloud`,
|
|
50
50
|
sólo se permiten en entidades hoja.
|
|
51
51
|
|
|
52
|
+
La presentación puede conservar una vista inicial sin introducir datos de
|
|
53
|
+
cámara en el algoritmo de layout:
|
|
54
|
+
|
|
55
|
+
```yaml
|
|
56
|
+
render:
|
|
57
|
+
camera:
|
|
58
|
+
position: [12.4, 7.2, 18.6]
|
|
59
|
+
target: [0, 1.5, 0]
|
|
60
|
+
zoom: 1.35
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Las coordenadas son coordenadas del modelo. `zoom` es un multiplicador de
|
|
64
|
+
encuadre independiente del tamaño del viewport y se conserva al compilar YAML
|
|
65
|
+
o Markdown.
|
|
66
|
+
|
|
52
67
|
Para compilar una fuente YAML durante el build:
|
|
53
68
|
|
|
54
69
|
```js
|
package/package.json
CHANGED
|
@@ -150,8 +150,11 @@ Optional fields include id, label, fromAnchor, toAnchor, priority and layout.
|
|
|
150
150
|
## Rendering
|
|
151
151
|
|
|
152
152
|
palette maps tokens to CSS colours. style.color or c can reference a token or direct
|
|
153
|
-
CSS colour. render can additionally set relationMode, selectionMode, toolbar
|
|
154
|
-
shellLabels
|
|
153
|
+
CSS colour. render can additionally set relationMode, selectionMode, toolbar,
|
|
154
|
+
shellLabels (the text-label contrast outline) and camera. An initial camera snapshot contains model-space
|
|
155
|
+
position and target vectors plus a positive, dimensionless zoom value. Position
|
|
156
|
+
and target determine the viewing direction; zoom preserves the intended framing
|
|
157
|
+
across viewport sizes. theme contains background, lighting and ui settings.
|
|
155
158
|
|
|
156
159
|
## Markdown blocks
|
|
157
160
|
|
package/src/index.js
CHANGED
|
@@ -1050,6 +1050,7 @@ export function compileAtlasModel(input, options = {}) {
|
|
|
1050
1050
|
relations,
|
|
1051
1051
|
layout: source.layout || undefined,
|
|
1052
1052
|
constraints: source.constraints || undefined,
|
|
1053
|
+
render: source.render || undefined,
|
|
1053
1054
|
diagnostics
|
|
1054
1055
|
};
|
|
1055
1056
|
if (options.throwOnFatal && diagnostics.some(item => item.level === "fatal")) throw new Error(diagnostics.filter(item => item.level === "fatal").map(item => item.message).join("\n"));
|
package/src/spec.js
CHANGED
|
@@ -136,7 +136,16 @@ export const ATLAS_LAYOUT_SPEC_V1 = freeze({
|
|
|
136
136
|
relationMode: field("Visible relation set.", ["all", "selected", "none"]),
|
|
137
137
|
selectionMode: field("Selection ownership.", ["internal", "event"]),
|
|
138
138
|
toolbar: field("Built-in toolbar visibility.", [true, false]),
|
|
139
|
-
shellLabels: field("
|
|
139
|
+
shellLabels: field("Text-label contrast outline.", [true, false]),
|
|
140
|
+
camera: field("Initial camera snapshot in model-space coordinates.", null, { context: "camera" })
|
|
141
|
+
})
|
|
142
|
+
}),
|
|
143
|
+
camera: freeze({
|
|
144
|
+
label: "Initial camera",
|
|
145
|
+
properties: freeze({
|
|
146
|
+
position: field("Camera position in model-space coordinates.", null, { type: "vector", required: true }),
|
|
147
|
+
target: field("Model-space point observed by the camera.", null, { type: "vector", required: true }),
|
|
148
|
+
zoom: field("Dimensionless framing multiplier.", null, { type: "number", required: true })
|
|
140
149
|
})
|
|
141
150
|
}),
|
|
142
151
|
span: freeze({
|
|
@@ -177,6 +186,7 @@ export function atlasLayoutContextForPath(path = []) {
|
|
|
177
186
|
["palette", "palette"],
|
|
178
187
|
["theme", "theme"],
|
|
179
188
|
["render", "render"],
|
|
189
|
+
["camera", "camera"],
|
|
180
190
|
["span", "span"],
|
|
181
191
|
["stagger", "stagger"],
|
|
182
192
|
["label", "label"],
|