Skip to content

Commit

Permalink
Merge pull request #89 from jan-dolejsi/ext_planview
Browse files Browse the repository at this point in the history
Ext planview
  • Loading branch information
jan-dolejsi authored Jan 13, 2021
2 parents 0892f87 + 0ee95ef commit 962aa00
Show file tree
Hide file tree
Showing 86 changed files with 1,870 additions and 1,055 deletions.
6 changes: 2 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,8 @@ tsc.log
coverage/
.nyc_output/
CHANGELOG.html
views/common/vis-network.min.*
views/common/codicon.*
/views/searchview/out/*.js
/views/searchview/out-test/
**/out-test/
src/test/tmpUserProfile/
src/test/tmpFolder/
debug.log
**/package-lock.json
18 changes: 17 additions & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,23 @@
"type": "chrome",
"request": "launch",
"name": "Search debugger (html)",
"file": "${workspaceFolder}/views/searchview/out/search.html"
"file": "${workspaceFolder}/views/searchview/static/search.html",
"cwd": "${workspaceFolder}/views/searchview/out",
"preLaunchTask": "npm: compile - views/searchview",
"outFiles": [
"${workspaceFolder}/views/searchview/out/**/*.js"
]
},
{
"type": "chrome",
"request": "launch",
"name": "Plan view (html)",
"file": "${workspaceFolder}/views/planview/static/plans.html",
"cwd": "${workspaceFolder}/views/planview/out",
"preLaunchTask": "npm: compile - views/planview",
"outFiles": [
"${workspaceFolder}/views/planview/out/**/*.js"
]
},
{
"type": "chrome",
Expand Down
37 changes: 37 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,20 @@
"type": "npm",
"script": "compile",
"group": "build",
"presentation": {
"panel": "dedicated",
"reveal": "always"
},
"problemMatcher": [
"$tsc"
]
},
{
"label": "compile - extension code only",
"type": "shell",
"command": "npx",
"args": ["tsc"],
"group": "build",
"presentation": {
"panel": "dedicated",
"reveal": "never"
Expand Down Expand Up @@ -55,6 +69,29 @@
"problemMatcher": [],
"label": "npm: compile - views/searchview",
"detail": "npm run lint && browserify src/search.ts -p tsify > out/search.js"
},
{
"type": "npm",
"script": "watch",
"path": "views/searchview/",
"problemMatcher": [
"$ts-webpack-watch"
],
"group": "build",
"label": "npm: watch - views/searchview",
"detail": "watchify src/search.ts -p tsify -o out/search.js --verbose",
"isBackground": true
},
{
"type": "npm",
"script": "compile",
"path": "views/planview/",
"problemMatcher": [
"$tsc"
],
"group": "build",
"label": "npm: compile - views/planview",
"detail": "npm run lint && browserify src/plans.ts -p tsify > out/plans.js"
}
]
}
15 changes: 13 additions & 2 deletions .vscodeignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@ test/**
src/**
**/*.map
.gitignore
.gitkeep
tsconfig.json
*.cmd
.vscode-test/**
.vscodeignore
package-lock.json
**/package-lock.json
**/.eslintrc.js
tsconfig.json
*.vsix
Expand All @@ -22,8 +23,18 @@ coverage/
.nyc_output/
.github/
downloadVisJs.js
how_to_contribute.md

views/common/node_modules

views/searchview/node_modules
views/searchview/out-test
views/searchview/src
views/searchview/test
views/searchview/tsconfig.json
views/searchview/tsconfig.json

views/planview/node_modules
views/planview/out-test
views/planview/src
views/planview/test
views/planview/tsconfig.json
39 changes: 33 additions & 6 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,33 @@
# PDDL support - What's new?

## [Unreleased] 2.19.5
## 2.20.0 - New and customizable Plan Visualization

### New faster plan visualization component with custom domain-specific plan visualization

The plan visualization component was extracted to a separate NPM package [pddl-gantt](https://www.npmjs.com/package/pddl-gantt).
This has two drivers:

* ability to replace the plan visualization in this extension
* ability to use this plan visualization as a plugin to editor.planning.domains
* faster search debugger view, which now hosts the same component

The new version is also going to display the plan faster.
What made the old one slow was the upfront evaluation of the line plots.
Now the line plots are evaluated lazily - only when they are scrolled into the view.

![Plan visualization in VS Code](https://raw.githubusercontent.com/wiki/jan-dolejsi/vscode-pddl/img/PDDL_plan_custom_vizualization.gif)

To study the files used in the above example, see [blocksworld.planviz.json](https://github.com/jan-dolejsi/vscode-pddl-samples/blob/master/Blocksworld/blocksworld.planviz.json) and [blocksWorldViz.js](https://github.com/jan-dolejsi/vscode-pddl-samples/blob/master/Blocksworld/blocksWorldViz.js).

To see all the options for plan visualization as HTML/DOM/SVG, see the function signatures here: [CustomVisualization.ts](https://github.com/jan-dolejsi/pddl-gantt/blob/master/src/CustomVisualization.ts).

### More usable plan preview and planner invocation via editor title icons

The planner invocation is now also available in the editor title context menu (by right-clicking on the editor tab of the domain/problem file).

Plan preview command is available in the editor title bar when a _.plan_ file is focussed. This is consistent by other file _preview_ extensions.
Plan preview command is available in the editor title bar when a _.plan_ file is focussed.

![Plan preview button](https://raw.githubusercontent.com/wiki/jan-dolejsi/vscode-pddl/img/plan_preview_button.jpg)

### Planner configuration and addition available from planner switch drop down

Expand All @@ -17,7 +38,11 @@ but none of those choices are at hand.

It is now possible to jump to the Overview Page and configure the planner right from the drop down that lets you select a planner.

> screenshot needed
![Adding and configuring planners through the status bar button](https://raw.githubusercontent.com/wiki/jan-dolejsi/vscode-pddl/img/adding_and_configuring_planners_through_status_bar.gif)

### Custom domain-specific plan/state visualization

Evolved the domain-specific plan/state visualization, which can be specified using the `customVisualization` (originally `planVisualizer`) property in the `<<domain>>.planviz.json` config file.

### Fixes

Expand All @@ -40,7 +65,8 @@ No longer attempting to display the `total-time` metric on the line-plot.

### Engineering work

Updated to latest VAL binaries (build 55).
* Dependencies updated to Node 12.14.1.
* Updated to latest VAL binaries (build 55).

## 2.19.4

Expand Down Expand Up @@ -418,7 +444,7 @@ Fixed opening the plan report in the default browser.
![Nunjucks sample](https://raw.githubusercontent.com/wiki/jan-dolejsi/vscode-pddl/img/PDDL_nunjucks_sample.gif)
* For templated problem files a code action (bulb) can open the live preview of the generated problem file
![Templated problem preview](https://raw.githubusercontent.com/wiki/jan-dolejsi/vscode-pddl/img/PDDL_templated_problem_preview.gif)
* Early preview of domain-specific plan/state visualization via the new `planVisualizer` property in the `<<domain>>.planviz.json` config file.
* Early preview of domain-specific plan/state visualization via the new `planVisualizer` property in the `<<domain>>.planviz.json` config file. This has since been renamed to `customVisualization`.
* Generated problem file previews are live updating when the data in .json file is modified!

### Fixes
Expand Down Expand Up @@ -1161,7 +1187,8 @@ Note for open source contributors: all notable changes to the "pddl" extension w

Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how to structure this file.

[Unreleased]: https://github.com/jan-dolejsi/vscode-pddl/compare/v2.19.0...HEAD
[Unreleased]: https://github.com/jan-dolejsi/vscode-pddl/compare/v2.20.0...HEAD
[2.20.0]:https://github.com/jan-dolejsi/vscode-pddl/compare/v2.19.0...v2.20.0
[2.19.0]:https://github.com/jan-dolejsi/vscode-pddl/compare/v2.18.0...v2.19.0
[2.18.0]:https://github.com/jan-dolejsi/vscode-pddl/compare/v2.17.1...v2.18.0
[2.17.1]:https://github.com/jan-dolejsi/vscode-pddl/compare/v2.16.0...v2.17.1
Expand Down
31 changes: 31 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,33 @@ It is now possible to exclude selected action parameters from swim-lane plan vis
}
```

#### Custom domain-specific plan visualization

![Plan visualization in VS Code](https://raw.githubusercontent.com/wiki/jan-dolejsi/vscode-pddl/img/PDDL_plan_custom_vizualization.gif)

To study the files used in the above example, see [blocksworld.planviz.json](https://github.com/jan-dolejsi/vscode-pddl-samples/blob/master/Blocksworld/blocksworld.planviz.json) ...

```json
{
"customVisualization": "blocksWorldViz.js"
}
```

... and [blocksWorldViz.js](https://github.com/jan-dolejsi/vscode-pddl-samples/blob/master/Blocksworld/blocksWorldViz.js).

```js
function visualizePlanHtml(plan, width) {
const height = 250;
return `...`; // your plan visualization logic goes here
}
module.exports = {
visualizePlanHtml: visualizePlanHtml,
};

```

To see all the options for plan visualization as HTML/DOM/SVG, see the function signatures here: [CustomVisualization.ts](https://github.com/jan-dolejsi/pddl-gantt/blob/master/src/CustomVisualization.ts).

#### Generate plan report

Plan visualization displays a menu symbol &#x2630; in the top-right corner, which shows applicable commands. For example the _PDDL: Generate plan report_, which opens the plan report generated into a self-contained HTML file that you can save and share/email.
Expand All @@ -235,6 +262,10 @@ Right-clicking on any `.plan` file offers _PDDL: Preview plan_ command to visual
;;!problem: problem-name
```

Plan preview command is available in the editor title bar when a _.plan_ file is focussed.

![Plan preview button](https://raw.githubusercontent.com/wiki/jan-dolejsi/vscode-pddl/img/plan_preview_button.jpg)

### Planning with command-line switches

When using a planner executable, further command-line options may be specified.
Expand Down
19 changes: 17 additions & 2 deletions clean.cmd
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
rmdir /S node_modules
rmdir /S /Q node_modules
rmdir /S /Q out
del package-lock.json

rmdir /S out
rmdir /S /Q views\common\node_modules
rmdir /S /Q views\common\out
rmdir /S /Q views\common\out-test
del views\common\package-lock.json

rmdir /S /Q views\planview\node_modules
rmdir /S /Q views\planview\out
rmdir /S /Q views\planview\out-test
del views\planview\package-lock.json

rmdir /S /Q views\searchview\node_modules
rmdir /S /Q views\searchview\out
rmdir /S /Q views\searchview\out-test
del views\searchview\package-lock.json
77 changes: 77 additions & 0 deletions images/dark/plan-preview.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 962aa00

Please sign in to comment.