Skip to content
This repository was archived by the owner on Jun 17, 2023. It is now read-only.

AlexFazio64 made a pull request #109

Open
wants to merge 20 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 11 additions & 12 deletions .vscodeignore
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
out/
node_modules/
*.vsix
.vscode
src/wrapper-dlv/.nyc_output
src/visualizer-matrix/.nyc_output
src/visualizer-matrix/coverage
src/visualizer-matrix/.vscode
src/visualizer-matrix/node_modules
src/visualizer-matrix/preview_*
**/*/package-lock.json
src/**/*/*.js
**/*.*
node_modules
src
.github

!dist
!README.md
!LICENSE.md
!package.json
!logo.png
!icon.png
836 changes: 478 additions & 358 deletions README.md

Large diffs are not rendered by default.

1,392 changes: 272 additions & 1,120 deletions package-lock.json

Large diffs are not rendered by default.

46 changes: 18 additions & 28 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,19 @@
"url": "https://github.com/Agile-visualizer-Team/visualizer-asp"
},
"description": "",
"version": "1.2.4",
"version": "1.4.2069",
"engines": {
"vscode": "^1.73.0"
},
"categories": [
"Other"
"Programming Languages",
"Other",
"Data Science",
"Visualization",
"Education"
],
"activationEvents": [
"onStartupFinished"
"onView:viewId.asp-vis.webview"
],
"main": "./dist/main.js",
"contributes": {
Expand All @@ -39,24 +43,12 @@
},
"commands": [
{
"command": "asp-vis.helloWorld",
"title": "Hello World"
"title": "ASP Visualizer: Render using configuration file",
"command": "asp-vis.execute"
},
{
"command": "asp-vis.wrapper",
"title": "Wrapper"
},
{
"command": "asp-vis.save",
"title": "Template"
},
{
"command": "asp-vis.execute",
"title": "ASP Visualizer: Run with config file"
},
{
"command": "asp-vis.ffmpeg",
"title": "ASP Visualizer: Convert to gif"
"title": "ASP Visualizer: Convert image sequence to GIF",
"command": "asp-vis.ffmpeg"
}
]
},
Expand All @@ -74,13 +66,15 @@
"b:webview": "echo ##### [BUILDING WEBVIEW] ##### && cd ./src/extension-main/svelte-app && npm run build",
"build:all": "npm run b:graph && npm run b:matrix && npm run b:integrator && npm run b:wrapper",
"compile": "npm run b:webview && py builder.py && webpack",
"vsix": "npm run b:webview && py builder.py && webpack --mode production --devtool hidden-source-map && vsce package",
"compile:p": "npm run b:webview && py builder.py && webpack --mode production --devtool hidden-source-map",
"compile:l": "python3 builder.py && webpack",
"watch": "py builder.py && webpack --watch",
"vscode:prepublish": "",
"package": "webpack --mode production --devtool hidden-source-map",
"lint": "eslint src --ext ts"
},
"devDependencies": {
"dependencies": {
"@types/glob": "^8.0.0",
"@types/mocha": "^10.0.0",
"@types/node": "16.x",
Expand All @@ -89,22 +83,18 @@
"@typescript-eslint/eslint-plugin": "^5.42.0",
"@typescript-eslint/parser": "^5.42.0",
"@vscode/test-electron": "^2.2.0",
"bufferutil": "^4.0.7",
"eslint": "^8.26.0",
"glob": "^8.0.3",
"mocha": "^10.1.0",
"node-html-to-image": "^3.2.4",
"puppeteer-core": "^19.6.2",
"table": "^6.8.1",
"ts-loader": "^9.4.1",
"typescript": "^4.8.4",
"utf-8-validate": "^5.0.10",
"webpack": "^5.75.0",
"webpack-cli": "^5.0.1"
},
"dependencies": {
"webpack-cli": "^5.0.1",
"ws": "^8.11.0"
},
"optionalDependencies": {
"bufferutil": "^4.0.7",
"utf-8-validate": "^5.0.10"
},
"icon": "logo.png"
}
66 changes: 0 additions & 66 deletions preview_matrix.html

This file was deleted.

71 changes: 37 additions & 34 deletions src/extension-main/check_workspace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,45 +25,48 @@ export function check_workspace() {
}
}

function handle_folder_creation(asp_vis_folder: string) {
vscode.window
.showInformationMessage(
"ASP Visualizer folder not found",
"create folder",
"ignore"
)
.then((val) => {
switch (val) {
case "create folder":
createFolder(asp_vis_folder);
break;
case "ignore":
vscode.window.showErrorMessage(
"ASP Visualizer will not work without a local folder"
);
break;
}
});
export function create_gif_script(asp_vis_folder: string) {
if (process.platform === "win32") {
fs.writeFileSync(
path.join(asp_vis_folder, "/gif.ps1"),
'$files = Get-ChildItem -Filter "*.png"\n$index = 0\nforeach ($file in $files) {\n$newName = "$index.png"\nRename-Item -Path $file.FullName -NewName $newName\n$index++\n}\nStart-Process -FilePath "ffmpeg.exe" -ArgumentList "-r 1 -start_number 0 -i %d.png ../answer_sets.gif -y"\n',
"utf8"
);
} else {
fs.writeFileSync(
path.join(asp_vis_folder, "/gif.sh"),
'#!/bin/bash\nfiles=$(ls *.png)\nindex=0\nfor file in $files\ndo\nnewName="$index.png"\nmv $file $newName\nindex=$((index+1))\ndone\nffmpeg -r 1 -start_number 0 -i "%d.png" ../answer_sets.gif -y',
"utf8"
);
}
}

export function createFolder(asp_vis_folder: string) {
if (fs.existsSync(asp_vis_folder)){
if (fs.existsSync(asp_vis_folder)) {
return;
}

vscode.window
.showErrorMessage(
"asp-vis folder not detected in the current workspace. Do you want to create it?",
"Create Folder",
"ignore"
)
.then((val) => {
if (val === "Create Folder") {
fs.mkdirSync(asp_vis_folder);
create_gif_script(asp_vis_folder);
read_config();
}

if (val === "ignore") {
vscode.window.showErrorMessage(
"ASP Visualizer will not work without a local folder"
);
}

fs.mkdirSync(asp_vis_folder);
fs.writeFileSync(
path.join(asp_vis_folder, "/gif.ps1"),
'$files = Get-ChildItem -Filter "*.png"\n$index = 0\nforeach ($file in $files) {\n$newName = "$index.png"\nRename-Item -Path $file.FullName -NewName $newName\n$index++\n}\nStart-Process -FilePath "ffmpeg.exe" -ArgumentList "-r 1 -start_number 0 -i %d.png answer_sets.gif -y"\n',
"utf8"
);
fs.writeFileSync(
path.join(asp_vis_folder, "/gif.sh"),
'#!/bin/bash\nfiles=$(ls *.png)\nindex=0\nfor file in $files\ndo\nnewName="$index.png"\nmv $file $newName\nindex=$((index+1))\ndone\nffmpeg -r 1 -start_number 0 -i "%d.png" answer_sets.gif -y',
"utf8"
);
read_config();
return;
});
}

export function check_folder() {
Expand All @@ -73,7 +76,7 @@ export function check_folder() {
let asp_vis_folder = path.join(folder_path, "asp-vis");

if (!fs.existsSync(asp_vis_folder)) {
handle_folder_creation(asp_vis_folder);
createFolder(asp_vis_folder);
}
}
}
Expand Down Expand Up @@ -117,6 +120,6 @@ export function read_config() {
"chrome.exe"
),
};
fs.writeFileSync(config_file, JSON.stringify(default_config));
fs.writeFileSync(config_file, JSON.stringify(default_config, null, 2));
}
}
10 changes: 0 additions & 10 deletions src/extension-main/gif.ps1

This file was deleted.

13 changes: 0 additions & 13 deletions src/extension-main/gif.sh

This file was deleted.

8 changes: 2 additions & 6 deletions src/extension-main/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,7 @@
document.getElementById("template-btn").addEventListener("click", () => {
vscode.postMessage({ type: "template" });
});
/*
document.getElementById("config-btn").addEventListener("click", () => {
vscode.postMessage({ type: "config", value: config_ta.value });
});
*/

document.getElementById("form-div").addEventListener("submit", (_e) => {
vscode.postMessage({ type: "config", value: config_ta.value });
});
Expand Down Expand Up @@ -94,7 +90,7 @@
config_ta.value = JSON.stringify(config, null, 2);
break;
case "folder_check":
//set folder button to disabled if the folder is not set
//set folder button to disabled if the folder does not exist
folder.disabled = message.value;
break;
}
Expand Down
Loading