Skip to content

Commit

Permalink
Fix issue with custom css
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert-96 committed Jun 17, 2023
1 parent 022adc0 commit d238755
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 8 deletions.
4 changes: 2 additions & 2 deletions css/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ body.vscode-dark {
--edge-color: var(--dark-edge-color);
--edge-label-color: var(--dark-edge-label-color);

--tootlip-text-color: var(--dark-edge-label-color);
--tooltip-text-color: var(--dark-edge-label-color);
}

body.vscode-high-contrast {
Expand All @@ -81,5 +81,5 @@ body.vscode-high-contrast {
--edge-color: var(--high-contrast-vertex-color);
--edge-label-color: var(--high-contrast-edge-text-color);

--tootlip-text-color: var(--high-contrast-edge-text-color);
--tooltip-text-color: var(--high-contrast-edge-text-color);
}
6 changes: 3 additions & 3 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export function activate(context: vscode.ExtensionContext) {
try {
panel.title = editorName.split(path.sep).pop() + " | " + extensionTitle;
panel.webview.postMessage({ command: 'newModel', model: JSON.parse(editorText)});
} catch (error: any) {
} catch (error) {
panel.webview.postMessage({ command: 'error', errorMessage: error.message, errorName: error.name});
}
}
Expand Down Expand Up @@ -111,7 +111,7 @@ export function activate(context: vscode.ExtensionContext) {
'legend': legend
};
panel.webview.postMessage({ command: 'newConfiguration', configuration: graphLayoutOptions});
} catch (error: any) {
} catch (error) {
panel.webview.postMessage({ command: 'error', errorMessage: error.message, errorName: error.name});
}
}
Expand All @@ -125,7 +125,7 @@ export function activate(context: vscode.ExtensionContext) {
if (panel) {
try {
panel.webview.postMessage({ command: 'newModel', model: JSON.parse(editorText)});
} catch (error: any) {
} catch (error) {
panel.webview.postMessage({ command: 'error', errorMessage: error.message, errorName: error.name});
}
}
Expand Down
14 changes: 11 additions & 3 deletions src/modelProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,28 +28,36 @@ export class ModelProvider {
const layoutMarginx = configuration.get('marginx');
const layoutMarginy = configuration.get('marginy');
const layoutLegend = configuration.get('legend');

return `<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>ModelVisualizer</title>
<title>Model Visualizer</title>
<!-- ModelVisualizer CSS -->
<link rel="stylesheet" href="https://altom.gitlab.io/altwalker/model-visualizer/build/model-visualizer.css">
<!-- CSS File -->
<link rel="stylesheet" href=${cssFilePath}/>
<link rel="stylesheet" href="${cssFilePath}" />
</head>
<body>
<div id="legend"></div>
<div id="visualizer"></div>
<!-- D3 -->
<script src=${d3LibraryPath}></script>
<!-- DagreD3 -->
<script src=${dagreD3LibrabryPath}></script>
<!-- D3 Legend -->
<script src=${d3LegendLibraryPath}></script>
<!-- Vue JS -->
<script src=${vueLibraryPath}></script>
<!-- Model-Visualizer -->
<script src="https://altom.gitlab.io/altwalker/model-visualizer/build/model-visualizer.js"></script>
<script>
Expand Down Expand Up @@ -150,4 +158,4 @@ export class ModelProvider {
</body>
</html>`;
}
}
}

0 comments on commit d238755

Please sign in to comment.