mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-05-04 22:06:06 +02:00
use oxfmt instead of prettier
This commit is contained in:
@@ -80,9 +80,19 @@ describe('graphLayoutWorker message protocol', () => {
|
||||
|
||||
harness.dispatch({
|
||||
requestId: 11,
|
||||
nodes: [{ id: 'n1', attributes: { x: 0, y: 0 } }, { id: 'n2', attributes: { x: 2, y: 2 } }],
|
||||
edges: [{ key: 'n1__n2', source: 'n1', target: 'n2', attributes: {} }],
|
||||
settings: { layoutIterations: 300, layoutSpacing: 60, deltaSpacing: 0, reinitialize: false }
|
||||
nodes: [
|
||||
{ id: 'n1', attributes: { x: 0, y: 0 } },
|
||||
{ id: 'n2', attributes: { x: 2, y: 2 } }
|
||||
],
|
||||
edges: [
|
||||
{ key: 'n1__n2', source: 'n1', target: 'n2', attributes: {} }
|
||||
],
|
||||
settings: {
|
||||
layoutIterations: 300,
|
||||
layoutSpacing: 60,
|
||||
deltaSpacing: 0,
|
||||
reinitialize: false
|
||||
}
|
||||
});
|
||||
|
||||
expect(harness.sent).toHaveLength(1);
|
||||
@@ -98,8 +108,15 @@ describe('graphLayoutWorker message protocol', () => {
|
||||
harness.dispatch({
|
||||
requestId: 12,
|
||||
nodes: [{ id: 'n1', attributes: { x: 0, y: 0 } }],
|
||||
edges: [{ key: 'n1__n2', source: 'n1', target: 'n2', attributes: {} }],
|
||||
settings: { layoutIterations: 300, layoutSpacing: 60, deltaSpacing: 0, reinitialize: false }
|
||||
edges: [
|
||||
{ key: 'n1__n2', source: 'n1', target: 'n2', attributes: {} }
|
||||
],
|
||||
settings: {
|
||||
layoutIterations: 300,
|
||||
layoutSpacing: 60,
|
||||
deltaSpacing: 0,
|
||||
reinitialize: false
|
||||
}
|
||||
});
|
||||
|
||||
expect(harness.sent).toHaveLength(1);
|
||||
|
||||
@@ -596,15 +596,15 @@
|
||||
const location = parseLocation(instanceData.location);
|
||||
|
||||
return `
|
||||
<div style="display: flex; align-items: center;">
|
||||
<div style="width: 10px; height: 55px; background-color: ${color}; margin-right: 6px;"></div>
|
||||
<div>
|
||||
<div>${name} #${location.instanceName} ${location.accessTypeName}</div>
|
||||
<div>${formattedJoinDateTime} - ${formattedLeftDateTime}</div>
|
||||
<div>${timeString}</div>
|
||||
<div style="display: flex; align-items: center;">
|
||||
<div style="width: 10px; height: 55px; background-color: ${color}; margin-right: 6px;"></div>
|
||||
<div>
|
||||
<div>${name} #${location.instanceName} ${location.accessTypeName}</div>
|
||||
<div>${formattedJoinDateTime} - ${formattedLeftDateTime}</div>
|
||||
<div>${timeString}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
`;
|
||||
};
|
||||
|
||||
const format = dtHour12.value ? 'hh:mm A' : 'HH:mm';
|
||||
|
||||
@@ -359,15 +359,15 @@
|
||||
const color = param.color;
|
||||
|
||||
return `
|
||||
<div style="display: flex; align-items: center;">
|
||||
<div style="width: 10px; height: 55px; background-color: ${color}; margin-right: 6px;"></div>
|
||||
<div>
|
||||
<div>${instanceData.display_name} ${friendOrFavIcon(instanceData.display_name)}</div>
|
||||
<div>${formattedJoinDateTime} - ${formattedLeftDateTime}</div>
|
||||
<div>${timeString}</div>
|
||||
<div style="display: flex; align-items: center;">
|
||||
<div style="width: 10px; height: 55px; background-color: ${color}; margin-right: 6px;"></div>
|
||||
<div>
|
||||
<div>${instanceData.display_name} ${friendOrFavIcon(instanceData.display_name)}</div>
|
||||
<div>${formattedJoinDateTime} - ${formattedLeftDateTime}</div>
|
||||
<div>${timeString}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
`;
|
||||
};
|
||||
|
||||
const format = dtHour12.value ? 'hh:mm A' : 'HH:mm';
|
||||
|
||||
@@ -403,11 +403,7 @@
|
||||
const edgeCurvatureModel = computed({
|
||||
get: () => [layoutSettings.edgeCurvature],
|
||||
set: (value) => {
|
||||
const next = clampNumber(
|
||||
value?.[0] ?? layoutSettings.edgeCurvature,
|
||||
EDGE_CURVATURE_MIN,
|
||||
EDGE_CURVATURE_MAX
|
||||
);
|
||||
const next = clampNumber(value?.[0] ?? layoutSettings.edgeCurvature, EDGE_CURVATURE_MIN, EDGE_CURVATURE_MAX);
|
||||
layoutSettings.edgeCurvature = Number(next.toFixed(2));
|
||||
}
|
||||
});
|
||||
@@ -468,11 +464,7 @@
|
||||
layoutSettings.layoutIterations = clampNumber(iterations, LAYOUT_ITERATIONS_MIN, LAYOUT_ITERATIONS_MAX);
|
||||
layoutSettings.layoutSpacing = clampNumber(spacing, LAYOUT_SPACING_MIN, LAYOUT_SPACING_MAX);
|
||||
layoutSettings.edgeCurvature = clampNumber(curvature, EDGE_CURVATURE_MIN, EDGE_CURVATURE_MAX);
|
||||
layoutSettings.communitySeparation = clampNumber(
|
||||
separation,
|
||||
COMMUNITY_SEPARATION_MIN,
|
||||
COMMUNITY_SEPARATION_MAX
|
||||
);
|
||||
layoutSettings.communitySeparation = clampNumber(separation, COMMUNITY_SEPARATION_MIN, COMMUNITY_SEPARATION_MAX);
|
||||
lastLayoutSpacing = layoutSettings.layoutSpacing;
|
||||
}
|
||||
|
||||
|
||||
@@ -90,7 +90,12 @@ function runLayout(data) {
|
||||
graph.addNode(node.id, node.attributes);
|
||||
}
|
||||
for (const edge of edges) {
|
||||
graph.addEdgeWithKey(edge.key, edge.source, edge.target, edge.attributes);
|
||||
graph.addEdgeWithKey(
|
||||
edge.key,
|
||||
edge.source,
|
||||
edge.target,
|
||||
edge.attributes
|
||||
);
|
||||
}
|
||||
|
||||
const reinitialize = settings.reinitialize ?? false;
|
||||
@@ -108,7 +113,9 @@ function runLayout(data) {
|
||||
LAYOUT_SPACING_MIN,
|
||||
LAYOUT_SPACING_MAX
|
||||
);
|
||||
const t = (spacing - LAYOUT_SPACING_MIN) / (LAYOUT_SPACING_MAX - LAYOUT_SPACING_MIN);
|
||||
const t =
|
||||
(spacing - LAYOUT_SPACING_MIN) /
|
||||
(LAYOUT_SPACING_MAX - LAYOUT_SPACING_MIN);
|
||||
const clampedT = clampNumber(t, 0, 1);
|
||||
const deltaSpacing = settings.deltaSpacing ?? 0;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user