Add a 3D view of every diagram; organise source by job; 0.6.0
3D view: a "3D" menu beside Export switches the diagram to a three.js scene built from the live Archify SVG. Nodes become blocks topped with the node as Archify draws it, relationships become lit pipes along Archify's routes, and the canvas, frames, lanes and legend form the floor. Clicks and hover go to the SVG nodes, so focus, the Semantic Passport and the intent trace work as in 2D; Archify's own animations (trace, node pulse, passport/path/lens flows) are mirrored live. The menu also offers flat or stacked levels, reset view and a top view; Export gains "3D view" (PNG). Trackpad scrolling pans, pinch and the mouse wheel zoom, and the zoom buttons work beyond the 2D limits. The scene draws only when something moves. New setting archify.defaultView. Source: src/ is split by job (commands, views, webview, archify, sources, language, util, viewer3d); behaviour unchanged.
This commit is contained in:
1 parent
20786f4b5a
commit
97b3b5f685
40 files changed
+2553
-353
No files matched your search
@@ -0,0 +1,8 @@
|
||||
import * as vscode from 'vscode';
|
||||
|
||||
/** Current text of a document: the open editor buffer, else the file on disk. */
|
||||
export async function readText(uri: vscode.Uri): Promise<string> {
|
||||
const open = vscode.workspace.textDocuments.find((doc) => doc.uri.toString() === uri.toString());
|
||||
if (open) return open.getText();
|
||||
return new TextDecoder('utf-8').decode(await vscode.workspace.fs.readFile(uri));
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
import * as vscode from 'vscode';
|
||||
|
||||
let output: vscode.LogOutputChannel | undefined;
|
||||
|
||||
export function log(): vscode.LogOutputChannel {
|
||||
output ??= vscode.window.createOutputChannel('Archify', { log: true });
|
||||
return output;
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
import * as vscode from 'vscode';
|
||||
import { ViewerTheme } from '../webview/page';
|
||||
|
||||
/** Diagram theme from archify.theme: forced, VS Code's, or the diagram's own. */
|
||||
export function viewerTheme(): ViewerTheme {
|
||||
const setting = vscode.workspace.getConfiguration('archify').get<string>('theme', 'vscode');
|
||||
if (setting === 'dark' || setting === 'light') return setting;
|
||||
if (setting === 'diagram') return undefined;
|
||||
const kind = vscode.window.activeColorTheme.kind;
|
||||
return kind === vscode.ColorThemeKind.Light || kind === vscode.ColorThemeKind.HighContrastLight ? 'light' : 'dark';
|
||||
}
|
||||
Reference in new issue
Block a user