Skip to content

Commit

Permalink
update code
Browse files Browse the repository at this point in the history
  • Loading branch information
bsteenwi committed Apr 17, 2024
1 parent f892ff2 commit fd13ab4
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 14 deletions.
Binary file added img/sparks_editor.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/editor/causes.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[{"id": "ajson1", "text": "Cause", "icon": false, "li_attr": {"id": "ajson1"}, "a_attr": {"href": "#", "id": "ajson1_anchor"}, "state": {"loaded": true, "opened": true, "selected": false, "disabled": false}, "data": {}, "children": [{"id": "j2_2", "text": "New node", "icon": true, "li_attr": {"id": "j2_2"}, "a_attr": {"href": "#", "id": "j2_2_anchor"}, "state": {"loaded": true, "opened": true, "selected": true, "disabled": false}, "data": {}, "children": [{"id": "j2_3", "text": "New node", "icon": true, "li_attr": {"id": "j2_3"}, "a_attr": {"href": "#", "id": "j2_3_anchor"}, "state": {"loaded": true, "opened": false, "selected": false, "disabled": false}, "data": {}, "children": [], "type": "default"}], "type": "default"}], "type": "default"}]
[{"id": "ajson1", "text": "Cause", "icon": false, "li_attr": {"id": "ajson1"}, "a_attr": {"href": "#", "id": "ajson1_anchor"}, "state": {"loaded": true, "opened": true, "selected": false, "disabled": false}, "data": {}, "children": [{"id": "j2_2", "text": "Other", "icon": true, "li_attr": {"id": "j2_2"}, "a_attr": {"href": "#", "id": "j2_2_anchor"}, "state": {"loaded": true, "opened": true, "selected": false, "disabled": false}, "data": {}, "children": [], "type": "default"}], "type": "default"}]
21 changes: 9 additions & 12 deletions src/editor/cgi-bin/semantify.py

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/editor/faults.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[{"id": "ajson1", "text": "Fault", "icon": false, "li_attr": {"id": "ajson1"}, "a_attr": {"href": "#", "id": "ajson1_anchor"}, "state": {"loaded": true, "opened": true, "selected": false, "disabled": false}, "data": {}, "children": [{"id": "j1_2", "text": "VolvoFaults", "icon": true, "li_attr": {"id": "j1_2"}, "a_attr": {"href": "#", "id": "j1_2_anchor"}, "state": {"loaded": true, "opened": true, "selected": false, "disabled": false}, "data": {}, "children": [], "type": "default"}, {"id": "j1_3", "text": "OtherCategory", "icon": true, "li_attr": {"id": "j1_3"}, "a_attr": {"href": "#", "id": "j1_3_anchor"}, "state": {"loaded": true, "opened": true, "selected": true, "disabled": false}, "data": {}, "children": [{"id": "j1_4", "text": "CertainFault", "icon": true, "li_attr": {"id": "j1_4"}, "a_attr": {"href": "#", "id": "j1_4_anchor"}, "state": {"loaded": true, "opened": false, "selected": false, "disabled": false}, "data": {}, "children": [], "type": "default"}], "type": "default"}], "type": "default"}]
[{"id": "ajson1", "text": "Fault", "icon": false, "li_attr": {"id": "ajson1"}, "a_attr": {"href": "#", "id": "ajson1_anchor"}, "state": {"loaded": true, "opened": true, "selected": false, "disabled": false}, "data": {}, "children": [{"id": "j1_2", "text": "VolvoFaults", "icon": true, "li_attr": {"id": "j1_2"}, "a_attr": {"href": "#", "id": "j1_2_anchor"}, "state": {"loaded": true, "opened": true, "selected": false, "disabled": false}, "data": {}, "children": [], "type": "default"}, {"id": "j1_3", "text": "OtherCategory", "icon": true, "li_attr": {"id": "j1_3"}, "a_attr": {"href": "#", "id": "j1_3_anchor"}, "state": {"loaded": true, "opened": true, "selected": true, "disabled": false}, "data": {}, "children": [{"id": "j1_4", "text": "CertainFault", "icon": true, "li_attr": {"id": "j1_4"}, "a_attr": {"href": "#", "id": "j1_4_anchor"}, "state": {"loaded": true, "opened": false, "selected": false, "disabled": false}, "data": {}, "children": [], "type": "default"}, {"id": "j1_5", "text": "NewFault", "icon": true, "li_attr": {"id": "j1_5"}, "a_attr": {"href": "#", "id": "j1_5_anchor"}, "state": {"loaded": true, "opened": false, "selected": false, "disabled": false}, "data": {}, "children": [], "type": "default"}], "type": "default"}], "type": "default"}]
10 changes: 10 additions & 0 deletions src/editor/litegraph-editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,16 @@ Editor.prototype.onCloudButton = function() {
data: { param: data},
}).done(function( o ) {
console.log(o)
var file = new Blob([o]);
var url = URL.createObjectURL(file);
var element = document.createElement("a");
element.setAttribute('href', url);
element.setAttribute('download', "untitled.ttl");
element.style.display = 'none';
document.body.appendChild(element);
element.click();
document.body.removeChild(element);
setTimeout(function () { URL.revokeObjectURL(url); }, 1000 * 60);
});
}

Expand Down
14 changes: 14 additions & 0 deletions src/editor/test_graph.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix sparks: <https://sparks.idlab.ugent.be/> .

<https://www.example.com/sparks/procedure/2/processinput/0> rdfs:label "In" ;
rdfs:type sparks:ProcessInput ;
sparks:isProcessInputOf <https://www.example.com/sparks/procedure/2> .

<https://www.example.com/sparks/process/1> a sparks:process ;
rdf:description "test1" .

<https://www.example.com/sparks/procedure/2> a sparks:procedure ;
rdf:description "Test2" .

0 comments on commit fd13ab4

Please sign in to comment.