worldorbit 2.5.11 → 2.5.13
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/dist/unpkg/worldorbit-core.min.js +5 -5
- package/dist/unpkg/worldorbit-markdown.min.js +20 -20
- package/dist/unpkg/worldorbit-viewer.min.js +29 -29
- package/dist/unpkg/worldorbit.js +38 -15
- package/dist/unpkg/worldorbit.min.js +36 -36
- package/package.json +1 -1
- package/packages/core/dist/atlas-edit.d.ts +11 -0
- package/packages/core/dist/atlas-edit.js +210 -0
- package/packages/core/dist/diagnostics.d.ts +10 -0
- package/packages/core/dist/diagnostics.js +109 -0
- package/packages/core/dist/draft-parse.d.ts +3 -0
- package/packages/core/dist/draft-parse.js +642 -0
- package/packages/core/dist/draft.d.ts +15 -0
- package/packages/core/dist/draft.js +343 -0
- package/packages/core/dist/errors.d.ts +7 -0
- package/packages/core/dist/errors.js +16 -0
- package/packages/core/dist/format.d.ts +4 -0
- package/packages/core/dist/format.js +364 -0
- package/packages/core/dist/index.d.ts +28 -0
- package/packages/core/dist/index.js +44 -0
- package/packages/core/dist/load.d.ts +4 -0
- package/packages/core/dist/load.js +130 -0
- package/packages/core/dist/markdown.d.ts +2 -0
- package/packages/core/dist/markdown.js +37 -0
- package/packages/core/dist/normalize.d.ts +2 -0
- package/packages/core/dist/normalize.js +304 -0
- package/packages/core/dist/parse.d.ts +2 -0
- package/packages/core/dist/parse.js +133 -0
- package/packages/core/dist/scene.d.ts +3 -0
- package/packages/core/dist/scene.js +1512 -0
- package/packages/core/dist/schema.d.ts +8 -0
- package/packages/core/dist/schema.js +298 -0
- package/packages/core/dist/tokenize.d.ts +4 -0
- package/packages/core/dist/tokenize.js +68 -0
- package/packages/core/dist/types.d.ts +382 -0
- package/packages/core/dist/types.js +1 -0
- package/packages/core/dist/validate.d.ts +2 -0
- package/packages/core/dist/validate.js +56 -0
- package/packages/editor/dist/editor.js +493 -121
package/dist/unpkg/worldorbit.js
CHANGED
|
@@ -1851,8 +1851,9 @@ var WorldOrbit = (() => {
|
|
|
1851
1851
|
}
|
|
1852
1852
|
const orbiting = [...context.orbitChildren.get(object.id) ?? []].sort(compareOrbiting);
|
|
1853
1853
|
const orbitMetricContext = computeOrbitMetricContext(orbiting, parent.radius, context.spacingFactor, context.scaleModel);
|
|
1854
|
+
const orbitRadiiPx = resolveOrbitRadiiPx(orbiting, orbitMetricContext);
|
|
1854
1855
|
orbiting.forEach((child, index) => {
|
|
1855
|
-
const orbitGeometry = resolveOrbitGeometry(child, index, orbiting.length, parent, orbitMetricContext, context);
|
|
1856
|
+
const orbitGeometry = resolveOrbitGeometry(child, index, orbiting.length, parent, orbitMetricContext, orbitRadiiPx[index] ?? orbitMetricContext.innerPx, context);
|
|
1856
1857
|
orbitDrafts.push({
|
|
1857
1858
|
object: child,
|
|
1858
1859
|
parentId: object.id,
|
|
@@ -1926,7 +1927,8 @@ var WorldOrbit = (() => {
|
|
|
1926
1927
|
metricSpread: 0,
|
|
1927
1928
|
innerPx,
|
|
1928
1929
|
stepPx,
|
|
1929
|
-
pixelSpread: Math.max(stepPx * Math.max(objects.length - 1, 1), stepPx)
|
|
1930
|
+
pixelSpread: Math.max(stepPx * Math.max(objects.length - 1, 1), stepPx),
|
|
1931
|
+
minimumGapPx: stepPx * 0.42
|
|
1930
1932
|
};
|
|
1931
1933
|
}
|
|
1932
1934
|
const minMetric = Math.min(...presentMetrics);
|
|
@@ -1939,10 +1941,11 @@ var WorldOrbit = (() => {
|
|
|
1939
1941
|
metricSpread,
|
|
1940
1942
|
innerPx,
|
|
1941
1943
|
stepPx,
|
|
1942
|
-
pixelSpread: Math.max(stepPx * Math.max(objects.length - 1, 1), stepPx)
|
|
1944
|
+
pixelSpread: Math.max(stepPx * Math.max(objects.length - 1, 1), stepPx),
|
|
1945
|
+
minimumGapPx: stepPx * 0.42
|
|
1943
1946
|
};
|
|
1944
1947
|
}
|
|
1945
|
-
function resolveOrbitGeometry(object, index, count, parent, metricContext, context) {
|
|
1948
|
+
function resolveOrbitGeometry(object, index, count, parent, metricContext, orbitRadiusPx, context) {
|
|
1946
1949
|
const placement = object.placement;
|
|
1947
1950
|
const band = object.type === "belt" || object.type === "ring";
|
|
1948
1951
|
if (!placement || placement.mode !== "orbit") {
|
|
@@ -1960,7 +1963,7 @@ var WorldOrbit = (() => {
|
|
|
1960
1963
|
};
|
|
1961
1964
|
}
|
|
1962
1965
|
const eccentricity = clampNumber(typeof placement.eccentricity === "number" ? placement.eccentricity : 0, 0, 0.92);
|
|
1963
|
-
const semiMajor =
|
|
1966
|
+
const semiMajor = orbitRadiusPx;
|
|
1964
1967
|
const baseMinor = Math.max(semiMajor * Math.sqrt(1 - eccentricity * eccentricity), semiMajor * 0.18);
|
|
1965
1968
|
const inclinationDeg = unitValueToDegrees(placement.inclination) ?? 0;
|
|
1966
1969
|
const inclinationScale = context.projection === "isometric" ? Math.max(MIN_ISO_MINOR_SCALE, Math.cos(degreesToRadians(inclinationDeg))) * ISO_FLATTENING : 1;
|
|
@@ -1990,15 +1993,19 @@ var WorldOrbit = (() => {
|
|
|
1990
1993
|
objectY: objectPoint.y
|
|
1991
1994
|
};
|
|
1992
1995
|
}
|
|
1993
|
-
function resolveOrbitRadiusPx(
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
1996
|
+
function resolveOrbitRadiusPx(metric, metricContext) {
|
|
1997
|
+
return metricContext.innerPx + metricContext.stepPx * log2(Math.max(metric, 0) + 1);
|
|
1998
|
+
}
|
|
1999
|
+
function resolveOrbitRadiiPx(objects, metricContext) {
|
|
2000
|
+
const radii = [];
|
|
2001
|
+
objects.forEach((object, index) => {
|
|
2002
|
+
const metric = orbitMetric(object);
|
|
2003
|
+
const fallbackRadius = metricContext.innerPx + index * metricContext.stepPx;
|
|
2004
|
+
const baseRadius = metric === null ? fallbackRadius : resolveOrbitRadiusPx(metric, metricContext);
|
|
2005
|
+
const minimumRadius = index === 0 ? metricContext.innerPx : (radii[index - 1] ?? metricContext.innerPx) + metricContext.minimumGapPx;
|
|
2006
|
+
radii.push(Math.max(baseRadius, minimumRadius));
|
|
2007
|
+
});
|
|
2008
|
+
return radii;
|
|
2002
2009
|
}
|
|
2003
2010
|
function orbitMetric(object) {
|
|
2004
2011
|
if (!object.placement || object.placement.mode !== "orbit") {
|
|
@@ -2006,6 +2013,9 @@ var WorldOrbit = (() => {
|
|
|
2006
2013
|
}
|
|
2007
2014
|
return toDistanceMetric(object.placement.semiMajor ?? object.placement.distance ?? null);
|
|
2008
2015
|
}
|
|
2016
|
+
function log2(value) {
|
|
2017
|
+
return Math.log(value) / Math.log(2);
|
|
2018
|
+
}
|
|
2009
2019
|
function resolveOrbitPhase(phase, index, count) {
|
|
2010
2020
|
const degreeValue = phase ? unitValueToDegrees(phase) : null;
|
|
2011
2021
|
if (degreeValue !== null) {
|
|
@@ -5426,6 +5436,9 @@ var WorldOrbit = (() => {
|
|
|
5426
5436
|
touchPoints.set(event.pointerId, point);
|
|
5427
5437
|
if (touchPoints.size === 2) {
|
|
5428
5438
|
touchGesture = createTouchGestureState(scene, state, touchPoints);
|
|
5439
|
+
} else if (touchPoints.size === 1) {
|
|
5440
|
+
dragDistance = 0;
|
|
5441
|
+
suppressClick = false;
|
|
5429
5442
|
}
|
|
5430
5443
|
return;
|
|
5431
5444
|
}
|
|
@@ -5443,7 +5456,9 @@ var WorldOrbit = (() => {
|
|
|
5443
5456
|
if (!behavior.touch || !touchPoints.has(event.pointerId)) {
|
|
5444
5457
|
return;
|
|
5445
5458
|
}
|
|
5446
|
-
touchPoints.
|
|
5459
|
+
const prevPoint = touchPoints.get(event.pointerId);
|
|
5460
|
+
const nextPoint2 = getViewportPointFromClient(event.clientX, event.clientY);
|
|
5461
|
+
touchPoints.set(event.pointerId, nextPoint2);
|
|
5447
5462
|
if (touchPoints.size === 2) {
|
|
5448
5463
|
if (!touchGesture) {
|
|
5449
5464
|
touchGesture = createTouchGestureState(scene, state, touchPoints);
|
|
@@ -5454,6 +5469,14 @@ var WorldOrbit = (() => {
|
|
|
5454
5469
|
const deltaX2 = current.center.x - touchGesture.startViewportCenter.x;
|
|
5455
5470
|
const deltaY2 = current.center.y - touchGesture.startViewportCenter.y;
|
|
5456
5471
|
updateState(panViewerState(zoomedState, deltaX2, deltaY2));
|
|
5472
|
+
} else if (touchPoints.size === 1) {
|
|
5473
|
+
const deltaX2 = nextPoint2.x - prevPoint.x;
|
|
5474
|
+
const deltaY2 = nextPoint2.y - prevPoint.y;
|
|
5475
|
+
dragDistance += Math.abs(deltaX2) + Math.abs(deltaY2);
|
|
5476
|
+
if (dragDistance > 2) {
|
|
5477
|
+
suppressClick = true;
|
|
5478
|
+
}
|
|
5479
|
+
updateState(panViewerState(state, deltaX2, deltaY2));
|
|
5457
5480
|
}
|
|
5458
5481
|
return;
|
|
5459
5482
|
}
|