@matdata/yasgui-graph-plugin 0.1.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE CHANGED
@@ -1,201 +1,201 @@
1
- Apache License
2
- Version 2.0, January 2004
3
- http://www.apache.org/licenses/
4
-
5
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
-
7
- 1. Definitions.
8
-
9
- "License" shall mean the terms and conditions for use, reproduction,
10
- and distribution as defined by Sections 1 through 9 of this document.
11
-
12
- "Licensor" shall mean the copyright owner or entity authorized by
13
- the copyright owner that is granting the License.
14
-
15
- "Legal Entity" shall mean the union of the acting entity and all
16
- other entities that control, are controlled by, or are under common
17
- control with that entity. For the purposes of this definition,
18
- "control" means (i) the power, direct or indirect, to cause the
19
- direction or management of such entity, whether by contract or
20
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
- outstanding shares, or (iii) beneficial ownership of such entity.
22
-
23
- "You" (or "Your") shall mean an individual or Legal Entity
24
- exercising permissions granted by this License.
25
-
26
- "Source" form shall mean the preferred form for making modifications,
27
- including but not limited to software source code, documentation
28
- source, and configuration files.
29
-
30
- "Object" form shall mean any form resulting from mechanical
31
- transformation or translation of a Source form, including but
32
- not limited to compiled object code, generated documentation,
33
- and conversions to other media types.
34
-
35
- "Work" shall mean the work of authorship, whether in Source or
36
- Object form, made available under the License, as indicated by a
37
- copyright notice that is included in or attached to the work
38
- (an example is provided in the Appendix below).
39
-
40
- "Derivative Works" shall mean any work, whether in Source or Object
41
- form, that is based on (or derived from) the Work and for which the
42
- editorial revisions, annotations, elaborations, or other modifications
43
- represent, as a whole, an original work of authorship. For the purposes
44
- of this License, Derivative Works shall not include works that remain
45
- separable from, or merely link (or bind by name) to the interfaces of,
46
- the Work and Derivative Works thereof.
47
-
48
- "Contribution" shall mean any work of authorship, including
49
- the original version of the Work and any modifications or additions
50
- to that Work or Derivative Works thereof, that is intentionally
51
- submitted to Licensor for inclusion in the Work by the copyright owner
52
- or by an individual or Legal Entity authorized to submit on behalf of
53
- the copyright owner. For the purposes of this definition, "submitted"
54
- means any form of electronic, verbal, or written communication sent
55
- to the Licensor or its representatives, including but not limited to
56
- communication on electronic mailing lists, source code control systems,
57
- and issue tracking systems that are managed by, or on behalf of, the
58
- Licensor for the purpose of discussing and improving the Work, but
59
- excluding communication that is conspicuously marked or otherwise
60
- designated in writing by the copyright owner as "Not a Contribution."
61
-
62
- "Contributor" shall mean Licensor and any individual or Legal Entity
63
- on behalf of whom a Contribution has been received by Licensor and
64
- subsequently incorporated within the Work.
65
-
66
- 2. Grant of Copyright License. Subject to the terms and conditions of
67
- this License, each Contributor hereby grants to You a perpetual,
68
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
- copyright license to reproduce, prepare Derivative Works of,
70
- publicly display, publicly perform, sublicense, and distribute the
71
- Work and such Derivative Works in Source or Object form.
72
-
73
- 3. Grant of Patent License. Subject to the terms and conditions of
74
- this License, each Contributor hereby grants to You a perpetual,
75
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
- (except as stated in this section) patent license to make, have made,
77
- use, offer to sell, sell, import, and otherwise transfer the Work,
78
- where such license applies only to those patent claims licensable
79
- by such Contributor that are necessarily infringed by their
80
- Contribution(s) alone or by combination of their Contribution(s)
81
- with the Work to which such Contribution(s) was submitted. If You
82
- institute patent litigation against any entity (including a
83
- cross-claim or counterclaim in a lawsuit) alleging that the Work
84
- or a Contribution incorporated within the Work constitutes direct
85
- or contributory patent infringement, then any patent licenses
86
- granted to You under this License for that Work shall terminate
87
- as of the date such litigation is filed.
88
-
89
- 4. Redistribution. You may reproduce and distribute copies of the
90
- Work or Derivative Works thereof in any medium, with or without
91
- modifications, and in Source or Object form, provided that You
92
- meet the following conditions:
93
-
94
- (a) You must give any other recipients of the Work or
95
- Derivative Works a copy of this License; and
96
-
97
- (b) You must cause any modified files to carry prominent notices
98
- stating that You changed the files; and
99
-
100
- (c) You must retain, in the Source form of any Derivative Works
101
- that You distribute, all copyright, patent, trademark, and
102
- attribution notices from the Source form of the Work,
103
- excluding those notices that do not pertain to any part of
104
- the Derivative Works; and
105
-
106
- (d) If the Work includes a "NOTICE" text file as part of its
107
- distribution, then any Derivative Works that You distribute must
108
- include a readable copy of the attribution notices contained
109
- within such NOTICE file, excluding those notices that do not
110
- pertain to any part of the Derivative Works, in at least one
111
- of the following places: within a NOTICE text file distributed
112
- as part of the Derivative Works; within the Source form or
113
- documentation, if provided along with the Derivative Works; or,
114
- within a display generated by the Derivative Works, if and
115
- wherever such third-party notices normally appear. The contents
116
- of the NOTICE file are for informational purposes only and
117
- do not modify the License. You may add Your own attribution
118
- notices within Derivative Works that You distribute, alongside
119
- or as an addendum to the NOTICE text from the Work, provided
120
- that such additional attribution notices cannot be construed
121
- as modifying the License.
122
-
123
- You may add Your own copyright statement to Your modifications and
124
- may provide additional or different license terms and conditions
125
- for use, reproduction, or distribution of Your modifications, or
126
- for any such Derivative Works as a whole, provided Your use,
127
- reproduction, and distribution of the Work otherwise complies with
128
- the conditions stated in this License.
129
-
130
- 5. Submission of Contributions. Unless You explicitly state otherwise,
131
- any Contribution intentionally submitted for inclusion in the Work
132
- by You to the Licensor shall be under the terms and conditions of
133
- this License, without any additional terms or conditions.
134
- Notwithstanding the above, nothing herein shall supersede or modify
135
- the terms of any separate license agreement you may have executed
136
- with Licensor regarding such Contributions.
137
-
138
- 6. Trademarks. This License does not grant permission to use the trade
139
- names, trademarks, service marks, or product names of the Licensor,
140
- except as required for reasonable and customary use in describing the
141
- origin of the Work and reproducing the content of the NOTICE file.
142
-
143
- 7. Disclaimer of Warranty. Unless required by applicable law or
144
- agreed to in writing, Licensor provides the Work (and each
145
- Contributor provides its Contributions) on an "AS IS" BASIS,
146
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
- implied, including, without limitation, any warranties or conditions
148
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
- PARTICULAR PURPOSE. You are solely responsible for determining the
150
- appropriateness of using or redistributing the Work and assume any
151
- risks associated with Your exercise of permissions under this License.
152
-
153
- 8. Limitation of Liability. In no event and under no legal theory,
154
- whether in tort (including negligence), contract, or otherwise,
155
- unless required by applicable law (such as deliberate and grossly
156
- negligent acts) or agreed to in writing, shall any Contributor be
157
- liable to You for damages, including any direct, indirect, special,
158
- incidental, or consequential damages of any character arising as a
159
- result of this License or out of the use or inability to use the
160
- Work (including but not limited to damages for loss of goodwill,
161
- work stoppage, computer failure or malfunction, or any and all
162
- other commercial damages or losses), even if such Contributor
163
- has been advised of the possibility of such damages.
164
-
165
- 9. Accepting Warranty or Additional Liability. While redistributing
166
- the Work or Derivative Works thereof, You may choose to offer,
167
- and charge a fee for, acceptance of support, warranty, indemnity,
168
- or other liability obligations and/or rights consistent with this
169
- License. However, in accepting such obligations, You may act only
170
- on Your own behalf and on Your sole responsibility, not on behalf
171
- of any other Contributor, and only if You agree to indemnify,
172
- defend, and hold each Contributor harmless for any liability
173
- incurred by, or claims asserted against, such Contributor by reason
174
- of your accepting any such warranty or additional liability.
175
-
176
- END OF TERMS AND CONDITIONS
177
-
178
- APPENDIX: How to apply the Apache License to your work.
179
-
180
- To apply the Apache License to your work, attach the following
181
- boilerplate notice, with the fields enclosed by brackets "[]"
182
- replaced with your own identifying information. (Don't include
183
- the brackets!) The text should be enclosed in the appropriate
184
- comment syntax for the file format. We also recommend that a
185
- file or class name and description of purpose be included on the
186
- same "printed page" as the copyright notice for easier
187
- identification within third-party archives.
188
-
189
- Copyright [yyyy] [name of copyright owner]
190
-
191
- Licensed under the Apache License, Version 2.0 (the "License");
192
- you may not use this file except in compliance with the License.
193
- You may obtain a copy of the License at
194
-
195
- http://www.apache.org/licenses/LICENSE-2.0
196
-
197
- Unless required by applicable law or agreed to in writing, software
198
- distributed under the License is distributed on an "AS IS" BASIS,
199
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
- See the License for the specific language governing permissions and
201
- limitations under the License.
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
package/README.md CHANGED
@@ -1,291 +1,301 @@
1
- # YASGUI Graph Plugin
2
-
3
- [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
4
- [![npm version](https://img.shields.io/npm/v/yasgui-graph-plugin.svg)](https://www.npmjs.com/package/yasgui-graph-plugin)
5
-
6
- A YASGUI plugin for visualizing SPARQL CONSTRUCT query results as interactive graphs with nodes (subjects/objects) and edges (predicates).
7
-
8
- ## ✨ Features
9
-
10
- - **🔷 Interactive Graph Visualization**: Automatic force-directed layout with smooth physics-based positioning
11
- - **🎨 Smart Color Coding**:
12
- - 🔵 Blue = URIs
13
- - 🟢 Green = rdf:type objects (classes)
14
- - 🔘 Grey = Literals
15
- - 🟡 Yellow = Blank nodes
16
- - **🔍 Navigation**: Mouse wheel zoom, drag to pan, "Zoom to Fit" button
17
- - **✋ Drag & Drop**: Reorganize nodes by dragging them to new positions
18
- - **💬 Tooltips**: Hover for full URI/literal details (300ms delay)
19
- - **⚡ Performance**: Handles up to 1,000 nodes with <2s render time
20
- - **♿ Accessible**: WCAG AA color contrast, keyboard navigation support
21
-
22
- ## 📦 Installation
23
-
24
- ### NPM
25
-
26
- ```bash
27
- npm install yasgui-graph-plugin @zazuko/yasgui vis-network
28
- ```
29
-
30
- ```javascript
31
- import Yasgui from '@zazuko/yasgui';
32
- import GraphPlugin from 'yasgui-graph-plugin';
33
-
34
- Yasgui.Yasr.registerPlugin('graph', GraphPlugin);
35
-
36
- const yasgui = new Yasgui(document.getElementById('yasgui'));
37
- ```
38
-
39
- ### CDN (UMD)
40
-
41
- ```html
42
- <!-- YASGUI -->
43
- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@zazuko/yasgui@4/build/yasgui.min.css">
44
- <script src="https://cdn.jsdelivr.net/npm/@zazuko/yasgui@4/build/yasgui.min.js"></script>
45
-
46
- <!-- Graph Plugin -->
47
- <script src="https://cdn.jsdelivr.net/npm/yasgui-graph-plugin/dist/yasgui-graph-plugin.min.js"></script>
48
-
49
- <script>
50
- // Plugin auto-registers as 'graph'
51
- const yasgui = new Yasgui(document.getElementById('yasgui'));
52
- </script>
53
- ```
54
-
55
- ## 🚀 Quick Start
56
-
57
- See the complete working example in [`demo/index.html`](./demo/index.html).
58
-
59
- ### Basic Usage
60
-
61
- ```javascript
62
- const yasgui = new Yasgui(document.getElementById('yasgui'), {
63
- requestConfig: {
64
- endpoint: 'https://dbpedia.org/sparql'
65
- }
66
- });
67
- ```
68
-
69
- ### Sample CONSTRUCT Query
70
-
71
- ```sparql
72
- PREFIX ex: <http://example.org/>
73
- PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
74
-
75
- CONSTRUCT {
76
- ex:Alice rdf:type ex:Person .
77
- ex:Alice ex:knows ex:Bob .
78
- ex:Alice ex:name "Alice" .
79
- ex:Bob rdf:type ex:Person .
80
- ex:Bob ex:name "Bob" .
81
- }
82
- WHERE {}
83
- ```
84
-
85
- After running the query, click the **"Graph"** tab to see the visualization.
86
-
87
- ## 🎮 User Guide
88
-
89
- ### Navigation
90
- - **Zoom**: Mouse wheel (scroll up = zoom in, scroll down = zoom out)
91
- - **Pan**: Click and drag the background
92
- - **Fit to View**: Click the "Zoom to Fit" button to center the entire graph
93
-
94
- ### Interaction
95
- - **Drag Nodes**: Click and drag any node to reposition it
96
- - **Tooltips**: Hover over nodes/edges for 300ms to see full details
97
-
98
- ### Understanding Colors
99
-
100
- | Color | Meaning | Example |
101
- |-------|---------|---------|
102
- | 🔵 Blue | URI nodes | `ex:Person`, `ex:Alice` |
103
- | 🟢 Green | rdf:type objects (classes) | `ex:Person` in `ex:Alice rdf:type ex:Person` |
104
- | 🔘 Grey | Literal values | `"Alice"`, `"30"^^xsd:integer` |
105
- | 🟡 Yellow | Blank nodes | `_:b1`, `_:addr1` |
106
-
107
- ## ⚙️ Configuration
108
-
109
- The plugin uses sensible defaults but can be customized by extending the `GraphPlugin` class:
110
-
111
- ```javascript
112
- class CustomGraphPlugin extends GraphPlugin {
113
- constructor(yasr) {
114
- super(yasr);
115
- }
116
-
117
- // Override network options
118
- getNetworkOptions() {
119
- return {
120
- ...super.getNetworkOptions(),
121
- physics: {
122
- enabled: true,
123
- stabilization: { iterations: 100 } // Faster but less optimal layout
124
- }
125
- };
126
- }
127
- }
128
-
129
- Yasgui.Yasr.registerPlugin('customGraph', CustomGraphPlugin);
130
- ```
131
-
132
- ## 🔧 Development
133
-
134
- ### Build
135
-
136
- ```bash
137
- npm install
138
- npm run build
139
- ```
140
-
141
- Output: `dist/yasgui-graph-plugin.min.js`
142
-
143
- ### Local Testing
144
-
145
- 1. Build the plugin: `npm run build`
146
- 2. Open `example/index.html` in a browser
147
- 3. Try the sample queries in different tabs
148
-
149
- ### Code Quality
150
-
151
- ```bash
152
- npm run lint # ESLint check
153
- npm run format # Prettier format
154
- ```
155
-
156
- ## 📚 Documentation
157
-
158
- - **[Quickstart Guide](./specs/001-construct-graph-viz/quickstart.md)** - Installation, usage, troubleshooting
159
- - **[Data Model](./specs/001-construct-graph-viz/data-model.md)** - Entity definitions and relationships
160
- - **[Contracts](./specs/001-construct-graph-viz/contracts/)** - API specifications for YASR plugin and vis-network integration
161
- - **[Specification](./specs/001-construct-graph-viz/spec.md)** - Complete feature specification
162
- - **[Constitution](./. specify/memory/constitution.md)** - Project governance and principles
163
-
164
- ## 🧪 Browser Compatibility
165
-
166
- Tested on latest 2 versions of:
167
- - Chrome
168
- - Firefox
169
- - Safari
170
- - Edge
171
-
172
- Requires ES2018+ support and Canvas API.
173
-
174
- ## 🤝 Contributing
175
-
176
- Contributions welcome! Please follow the project constitution (`.specify/memory/constitution.md`) for governance principles:
177
-
178
- 1. **Plugin-First Architecture** - No YASGUI core modifications
179
- 2. **Visualization Quality** - Performance (<2s for 1k nodes), accessibility (WCAG AA)
180
- 3. **Configuration Flexibility** - Sensible defaults, but customizable
181
- 4. **Browser Compatibility** - ES2018+, latest 2 browser versions
182
- 5. **Documentation** - Keep docs updated with changes
183
-
184
- ## 📄 License
185
-
186
- [Apache 2.0](./LICENSE)
187
-
188
- ## 🙏 Acknowledgments
189
-
190
- - Built with [vis-network](https://visjs.github.io/vis-network/) for graph rendering
191
- - Integrates with [YASGUI](https://github.com/zazuko/yasgui) SPARQL editor
192
- - Follows the [yasgui-geo](https://github.com/zazuko/yasgui-geo) plugin pattern
193
-
194
- ## 📊 Project Status
195
-
196
- **Current Version**: 0.1.0 (MVP)
197
-
198
- **Implemented Features** (v0.1.0):
199
- - Basic graph visualization (US1)
200
- - Navigation controls (US2)
201
- - Color-coded nodes
202
- - ✅ Prefix abbreviation
203
- - Blank node support
204
- - ✅ Performance optimization
205
-
206
- **Planned Features** (Future):
207
- - Enhanced tooltips with datatype display (US4)
208
- - Manual testing across all browsers (US3 verification)
209
- - Large graph optimization (>1k nodes)
210
- - Custom color schemes
211
- - Layout algorithm selection
212
-
213
- ## 🐛 Troubleshooting
214
-
215
- ### Plugin tab not showing
216
- - Ensure query type is **CONSTRUCT** (not SELECT/ASK/DESCRIBE)
217
- - Check browser console for errors
218
- - Verify YASGUI version is ^4.0.0
219
-
220
- ### Empty visualization
221
- - Confirm CONSTRUCT query returns triples (check "Table" or "Response" tab)
222
- - Verify results have subject/predicate/object structure
223
-
224
- ### Performance issues
225
- - Limit results to <1000 nodes for best performance
226
- - Disable physics after initial layout (automatic)
227
- - Consider using LIMIT clause in SPARQL query
228
-
229
- For more help, see [Quickstart Guide - Troubleshooting](./specs/001-construct-graph-viz/quickstart.md#troubleshooting).
230
-
231
- ## 🛠️ Development
232
-
233
- ### Setup
234
-
235
- ```bash
236
- git clone https://github.com/yourusername/yasgui-graph-plugin.git
237
- cd yasgui-graph-plugin
238
- npm install
239
- ```
240
-
241
- ### Dev Workflow (Live Reload)
242
-
243
- The project supports **live development** - edit source files and see changes immediately without rebuilding:
244
-
245
- 1. **Start a local dev server** (any HTTP server will work):
246
- ```bash
247
- # Using Python
248
- python -m http.server 8000
249
-
250
- # Using Node.js (http-server)
251
- npx http-server -p 8000
252
-
253
- # Using VS Code Live Server extension
254
- # Right-click demo/index.html → "Open with Live Server"
255
- ```
256
-
257
- 2. **Open demo in browser**:
258
- ```
259
- http://localhost:8000/demo/index.html
260
- ```
261
-
262
- 3. **Edit source files** (e.g., `src/colorUtils.js`):
263
- ```javascript
264
- export function getNodeColor(node) {
265
- // Change colors here
266
- if (node.isBlankNode) return '#FF00FF'; // Magenta
267
- // ...
268
- }
269
- ```
270
-
271
- 4. **Refresh browser** - changes appear immediately! ⚡
272
-
273
- The demo automatically loads ES modules directly from `src/` in development mode, so no rebuild is needed.
274
-
275
- ### Production Build
276
-
277
- Build the minified UMD bundle for distribution:
278
-
279
- ```bash
280
- npm run build
281
- ```
282
-
283
- Output: `dist/yasgui-graph-plugin.min.js` (bundled with vis-network)
284
-
285
- ### Testing
286
-
287
- ```bash
288
- npm test # Run all tests
289
- npm run lint # Check code style
290
- npm run format # Auto-fix formatting
291
- ```
1
+ # YASGUI Graph Plugin
2
+
3
+ [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
4
+ [![npm version](https://img.shields.io/npm/v/yasgui-graph-plugin.svg)](https://www.npmjs.com/package/yasgui-graph-plugin)
5
+
6
+ A YASGUI plugin for visualizing SPARQL CONSTRUCT and DESCRIBE query results as interactive graphs with nodes (subjects/objects) and edges (predicates).
7
+
8
+ ## ✨ Features
9
+
10
+ - **🔷 Interactive Graph Visualization**: Automatic force-directed layout with smooth physics-based positioning
11
+ - **🎨 Smart Color Coding**:
12
+ - 🔵 Light Blue (#97C2FC) = URIs
13
+ - 🟢 Light Green (#a6c8a6ff) = Literals
14
+ - Light Grey (#c5c5c5ff) = Blank nodes
15
+ - 🟠 Orange (#e15b13ff) = rdf:type objects (classes)
16
+ - **🔍 Navigation**: Mouse wheel zoom, drag to pan, "Zoom to Fit" button
17
+ - **✋ Drag & Drop**: Reorganize nodes by dragging them to new positions
18
+ - **💬 Tooltips**: Hover for full URI/literal details (300ms delay)
19
+ - **⚡ Performance**: Handles up to 1,000 nodes with <2s render time
20
+ - **♿ Accessible**: WCAG AA color contrast, keyboard navigation support
21
+
22
+ ## 📦 Installation
23
+
24
+ ### NPM
25
+
26
+ ```bash
27
+ npm install yasgui-graph-plugin @zazuko/yasgui vis-network
28
+ ```
29
+
30
+ ```javascript
31
+ import Yasgui from '@zazuko/yasgui';
32
+ import GraphPlugin from 'yasgui-graph-plugin';
33
+
34
+ Yasgui.Yasr.registerPlugin('Graph', GraphPlugin);
35
+
36
+ const yasgui = new Yasgui(document.getElementById('yasgui'));
37
+ ```
38
+
39
+ ### CDN (UMD)
40
+
41
+ ```html
42
+ <!-- YASGUI -->
43
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@zazuko/yasgui@4/build/yasgui.min.css">
44
+ <script src="https://cdn.jsdelivr.net/npm/@zazuko/yasgui@4/build/yasgui.min.js"></script>
45
+
46
+ <!-- Graph Plugin -->
47
+ <script src="https://cdn.jsdelivr.net/npm/yasgui-graph-plugin/dist/yasgui-graph-plugin.min.js"></script>
48
+
49
+ <script>
50
+ // Plugin auto-registers as 'graph'
51
+ const yasgui = new Yasgui(document.getElementById('yasgui'));
52
+ </script>
53
+ ```
54
+
55
+ ## 🚀 Quick Start
56
+
57
+ See the complete working example in [`demo/index.html`](./demo/index.html).
58
+
59
+ ### Basic Usage
60
+
61
+ ```javascript
62
+ const yasgui = new Yasgui(document.getElementById('yasgui'), {
63
+ requestConfig: {
64
+ endpoint: 'https://dbpedia.org/sparql'
65
+ }
66
+ });
67
+ ```
68
+
69
+ ### Sample Queries
70
+
71
+ **CONSTRUCT Query:**
72
+ ```sparql
73
+ PREFIX ex: <http://example.org/>
74
+ PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
75
+
76
+ CONSTRUCT {
77
+ ex:Alice rdf:type ex:Person .
78
+ ex:Alice ex:knows ex:Bob .
79
+ ex:Alice ex:name "Alice" .
80
+ ex:Bob rdf:type ex:Person .
81
+ ex:Bob ex:name "Bob" .
82
+ }
83
+ WHERE {}
84
+ ```
85
+
86
+ **DESCRIBE Query:**
87
+ ```sparql
88
+ PREFIX ex: <http://example.org/>
89
+
90
+ # Returns all triples about the specified resources
91
+ DESCRIBE ex:Alice ex:Bob
92
+ ```
93
+
94
+ After running the query, click the **"Graph"** tab to see the visualization.
95
+
96
+ ## 🎮 User Guide
97
+
98
+ ### Navigation
99
+ - **Zoom**: Mouse wheel (scroll up = zoom in, scroll down = zoom out)
100
+ - **Pan**: Click and drag the background
101
+ - **Fit to View**: Click the "Zoom to Fit" button to center the entire graph
102
+
103
+ ### Interaction
104
+ - **Drag Nodes**: Click and drag any node to reposition it
105
+ - **Tooltips**: Hover over nodes/edges for 300ms to see full details
106
+
107
+ ### Understanding Colors
108
+
109
+ | Color | Meaning | Example |
110
+ |-------|---------|---------||
111
+ | 🔵 Light Blue (#97C2FC) | URI nodes | `ex:Person`, `ex:Alice` |
112
+ | 🟢 Light Green (#a6c8a6ff) | Literal values | `"Alice"`, `"30"^^xsd:integer` |
113
+ | ⚪ Light Grey (#c5c5c5ff) | Blank nodes | `_:b1`, `_:addr1` |
114
+ | 🟠 Orange (#e15b13ff) | rdf:type objects (classes) | `ex:Person` in `ex:Alice rdf:type ex:Person` |
115
+
116
+ ## ⚙️ Configuration
117
+
118
+ The plugin uses sensible defaults but can be customized by extending the `GraphPlugin` class:
119
+
120
+ ```javascript
121
+ class CustomGraphPlugin extends GraphPlugin {
122
+ constructor(yasr) {
123
+ super(yasr);
124
+ }
125
+
126
+ // Override network options
127
+ getNetworkOptions() {
128
+ return {
129
+ ...super.getNetworkOptions(),
130
+ physics: {
131
+ enabled: true,
132
+ stabilization: { iterations: 100 } // Faster but less optimal layout
133
+ }
134
+ };
135
+ }
136
+ }
137
+
138
+ Yasgui.Yasr.registerPlugin('customGraph', CustomGraphPlugin);
139
+ ```
140
+
141
+ ## 🔧 Development
142
+
143
+ ### Build
144
+
145
+ ```bash
146
+ npm install
147
+ npm run build
148
+ ```
149
+
150
+ Output: `dist/yasgui-graph-plugin.min.js`
151
+
152
+ ### Local Testing
153
+
154
+ 1. Build the plugin: `npm run build`
155
+ 2. Open `example/index.html` in a browser
156
+ 3. Try the sample queries in different tabs
157
+
158
+ ### Code Quality
159
+
160
+ ```bash
161
+ npm run lint # ESLint check
162
+ npm run format # Prettier format
163
+ ```
164
+
165
+ ## 📚 Documentation
166
+
167
+ - **[Quickstart Guide](./specs/001-construct-graph-viz/quickstart.md)** - Installation, usage, troubleshooting
168
+ - **[Data Model](./specs/001-construct-graph-viz/data-model.md)** - Entity definitions and relationships
169
+ - **[Contracts](./specs/001-construct-graph-viz/contracts/)** - API specifications for YASR plugin and vis-network integration
170
+ - **[Specification](./specs/001-construct-graph-viz/spec.md)** - Complete feature specification
171
+ - **[Constitution](./. specify/memory/constitution.md)** - Project governance and principles
172
+
173
+ ## 🧪 Browser Compatibility
174
+
175
+ Tested on latest 2 versions of:
176
+ - Chrome
177
+ - ✅ Firefox
178
+ - Safari
179
+ - Edge
180
+
181
+ Requires ES2018+ support and Canvas API.
182
+
183
+ ## 🤝 Contributing
184
+
185
+ Contributions welcome! Please follow the project constitution (`.specify/memory/constitution.md`) for governance principles:
186
+
187
+ 1. **Plugin-First Architecture** - No YASGUI core modifications
188
+ 2. **Visualization Quality** - Performance (<2s for 1k nodes), accessibility (WCAG AA)
189
+ 3. **Configuration Flexibility** - Sensible defaults, but customizable
190
+ 4. **Browser Compatibility** - ES2018+, latest 2 browser versions
191
+ 5. **Documentation** - Keep docs updated with changes
192
+
193
+ ## 📄 License
194
+
195
+ [Apache 2.0](./LICENSE)
196
+
197
+ ## 🙏 Acknowledgments
198
+
199
+ - Built with [vis-network](https://visjs.github.io/vis-network/) for graph rendering
200
+ - Integrates with [YASGUI](https://github.com/zazuko/yasgui) SPARQL editor
201
+ - Follows the [yasgui-geo](https://github.com/zazuko/yasgui-geo) plugin pattern
202
+
203
+ ## 📊 Project Status
204
+
205
+ **Current Version**: 0.1.0 (MVP)
206
+
207
+ **Implemented Features** (v0.1.0):
208
+ - Basic graph visualization (US1)
209
+ - Navigation controls (US2)
210
+ - Color-coded nodes
211
+ - Prefix abbreviation
212
+ - ✅ Blank node support
213
+ - Performance optimization
214
+
215
+ **Planned Features** (Future):
216
+ - Enhanced tooltips with datatype display (US4)
217
+ - Manual testing across all browsers (US3 verification)
218
+ - Large graph optimization (>1k nodes)
219
+ - ⏳ Custom color schemes
220
+ - Layout algorithm selection
221
+
222
+ ## 🐛 Troubleshooting
223
+
224
+ ### Plugin tab not showing
225
+ - Verify plugin is registered correctly
226
+ - Check browser console for errors
227
+ - Verify YASGUI version is ^4.0.0
228
+
229
+ ### Empty visualization
230
+ - Ensure query type is **CONSTRUCT** or **DESCRIBE**
231
+ - Confirm query returns triples (check "Table" or "Response" tab)
232
+ - Verify results have RDF structure
233
+
234
+ ### Performance issues
235
+ - Limit results to <1000 nodes for best performance
236
+ - Disable physics after initial layout
237
+ - Consider using LIMIT clause in SPARQL query
238
+
239
+ For more help, see [Quickstart Guide - Troubleshooting](./specs/001-construct-graph-viz/quickstart.md#troubleshooting).
240
+
241
+ ## 🛠️ Development
242
+
243
+ ### Setup
244
+
245
+ ```bash
246
+ git clone https://github.com/yourusername/yasgui-graph-plugin.git
247
+ cd yasgui-graph-plugin
248
+ npm install
249
+ ```
250
+
251
+ ### Dev Workflow (Live Reload)
252
+
253
+ The project supports **live development** - edit source files and see changes immediately without rebuilding:
254
+
255
+ 1. **Start a local dev server** (any HTTP server will work):
256
+ ```bash
257
+ # Using Python
258
+ python -m http.server 8000
259
+
260
+ # Using Node.js (http-server)
261
+ npx http-server -p 8000
262
+
263
+ # Using VS Code Live Server extension
264
+ # Right-click demo/index.html → "Open with Live Server"
265
+ ```
266
+
267
+ 2. **Open demo in browser**:
268
+ ```
269
+ http://localhost:8000/demo/index.html
270
+ ```
271
+
272
+ 3. **Edit source files** (e.g., `src/colorUtils.js`):
273
+ ```javascript
274
+ export function getNodeColor(node) {
275
+ // Change colors here
276
+ if (node.isBlankNode) return '#FF00FF'; // Magenta
277
+ // ...
278
+ }
279
+ ```
280
+
281
+ 4. **Refresh browser** - changes appear immediately! ⚡
282
+
283
+ The demo automatically loads ES modules directly from `src/` in development mode, so no rebuild is needed.
284
+
285
+ ### Production Build
286
+
287
+ Build the minified UMD bundle for distribution:
288
+
289
+ ```bash
290
+ npm run build
291
+ ```
292
+
293
+ Output: `dist/yasgui-graph-plugin.min.js` (bundled with vis-network)
294
+
295
+ ### Testing
296
+
297
+ ```bash
298
+ npm test # Run all tests
299
+ npm run lint # Check code style
300
+ npm run format # Auto-fix formatting
301
+ ```
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@matdata/yasgui-graph-plugin",
3
3
  "private": false,
4
- "version": "0.1.0",
5
- "description": "YASGUI plugin for visualizing SPARQL CONSTRUCT query results as interactive graphs",
4
+ "version": "1.0.1",
5
+ "description": "YASGUI plugin for visualizing SPARQL CONSTRUCT and DESCRIBE query results as interactive graphs",
6
6
  "main": "dist/yasgui-graph-plugin.min.js",
7
7
  "scripts": {
8
8
  "dev": "vite",
@@ -15,7 +15,13 @@
15
15
  "type": "git",
16
16
  "url": "git+https://github.com/Matdata-eu/yasgui-graph-plugin.git"
17
17
  },
18
- "keywords": ["yasgui", "sparql", "rdf", "graph", "visualization"],
18
+ "keywords": [
19
+ "yasgui",
20
+ "sparql",
21
+ "rdf",
22
+ "graph",
23
+ "visualization"
24
+ ],
19
25
  "author": "Matdata",
20
26
  "license": "Apache-2.0",
21
27
  "type": "commonjs",
@@ -1,2 +0,0 @@
1
- var GraphPlugin=(()=>{var f=Object.defineProperty;var E=Object.getOwnPropertyDescriptor;var N=Object.getOwnPropertyNames;var C=Object.prototype.hasOwnProperty;var L=(t,e)=>{for(var s in e)f(t,s,{get:e[s],enumerable:!0})},z=(t,e,s,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of N(e))!C.call(t,o)&&o!==s&&f(t,o,{get:()=>e[o],enumerable:!(r=E(e,o))||r.enumerable});return t};var $=t=>z(f({},"__esModule",{value:!0}),t);var V={};L(V,{default:()=>P});function w(t){let e=new Map;if(t&&t.getVariables){let r=t.getVariables();r&&r.prefixes&&Object.entries(r.prefixes).forEach(([o,n])=>{e.set(n,o)})}return Object.entries({"http://www.w3.org/1999/02/22-rdf-syntax-ns#":"rdf","http://www.w3.org/2000/01/rdf-schema#":"rdfs","http://www.w3.org/2001/XMLSchema#":"xsd","http://www.w3.org/2002/07/owl#":"owl"}).forEach(([r,o])=>{e.has(r)||e.set(r,o)}),e}function l(t,e){if(!t||typeof t!="string")return t;for(let[s,r]of e.entries())if(t.startsWith(s)){let o=t.substring(s.length);return`${r}:${o}`}return t}function p(t,e=50){return!t||typeof t!="string"||t.length<=e?t:t.substring(0,e-3)+"..."}function b(){return{autoResize:!0,width:"100%",height:"100%",physics:{enabled:!0,stabilization:{enabled:!0,iterations:200,updateInterval:25},barnesHut:{gravitationalConstant:-2e3,centralGravity:.3,springLength:95,springConstant:.04,damping:.09}},interaction:{dragNodes:!0,dragView:!0,zoomView:!0,hover:!0,tooltipDelay:300},nodes:{shape:"ellipse",size:25,font:{size:14,color:"#000000"},borderWidth:2,borderWidthSelected:3},edges:{arrows:{to:{enabled:!0,scaleFactor:.5}},smooth:{enabled:!0,type:"dynamic"},font:{size:12,align:"middle"}}}}function m(t){let e=[];return!t||!t.getBindings||t.getBindings().forEach(r=>{if(!r.subject||!r.predicate||!r.object)return;let o={subject:r.subject.value,predicate:r.predicate.value,object:{value:r.object.value,type:r.object.type||"uri",datatype:r.object.datatype,lang:r.object["xml:lang"]}};e.push(o)}),e}function g(t,e){return t.uri&&t.uri.startsWith("_:")?"#e15b13ff":t.type==="literal"?"#808080":e.some(r=>r.predicate==="http://www.w3.org/1999/02/22-rdf-syntax-ns#type"&&r.object.value===t.uri)?"#068e06ff":"#4949c6ff"}function B(t,e){let s=new Map,r=1;return t.forEach(o=>{if(!s.has(o.subject)){let i=o.subject.startsWith("_:"),a=i?o.subject:p(l(o.subject,e));s.set(o.subject,{id:r++,uri:o.subject,label:a,color:g({uri:o.subject,type:"uri"},t),type:"uri",fullValue:o.subject,title:i?o.subject:l(o.subject,e)})}let n=o.object.value;if(!s.has(n)){let i=o.object.type==="literal",a=!i&&n.startsWith("_:"),c,u,d;i?(c=p(n),u=n,d=o.object.datatype?`"${n}"^^${l(o.object.datatype,e)}`:`"${n}"`):a?(c=n,u=n,d=n):(c=p(l(n,e)),u=n,d=l(n,e)),s.set(n,{id:r++,uri:i?null:n,label:c,color:g({uri:n,type:i?"literal":"uri"},t),type:i?"literal":"uri",fullValue:u,title:d})}}),s}function O(t,e,s){let r=[],o=new Set;return t.forEach(n=>{let i=e.get(n.subject),a=e.get(n.object.value);if(!i||!a)return;let c=`${i.id}-${n.predicate}-${a.id}`;o.has(c)||(o.add(c),r.push({id:`edge_${i.id}_${a.id}_${r.length}`,from:i.id,to:a.id,label:p(l(n.predicate,s)),predicate:n.predicate,title:l(n.predicate,s),arrows:"to"}))}),r}function j(t,e){let s=B(t,e),r=O(t,s,e);return{nodes:Array.from(s.values()),edges:r}}function S(){if(typeof window!="undefined"&&window.vis)return window.vis;throw new Error("vis-network not found. Load vis-network before GraphPlugin in dev mode.")}var h=class{constructor(e){this.yasr=e,this.network=null}static get priority(){return 20}static get label(){return"Graph"}canHandleResults(){if(!this.yasr||!this.yasr.results)return!1;let e=this.yasr.results;if(e.getBindings&&typeof e.getBindings=="function"){let s=e.getBindings();if(s&&s.length>0){let r=s[0];return r.subject!==void 0&&r.predicate!==void 0&&r.object!==void 0}}return!1}draw(){this.yasr.resultsEl.innerHTML="";try{let e=m(this.yasr.results);if(!e||e.length===0){this.yasr.resultsEl.innerHTML='<div style="padding: 20px; text-align: center; color: #666;">No graph data to visualize</div>';return}let s=w(this.yasr.results),{nodes:r,edges:o}=j(e,s),n=document.createElement("div");n.style.width="100%",n.style.height="600px",n.style.position="relative",n.style.overflow="hidden",this.yasr.resultsEl.appendChild(n);let i=document.createElement("div");i.style.position="absolute",i.style.top="10px",i.style.right="10px",i.style.zIndex="1000",i.style.display="flex",i.style.gap="10px",n.appendChild(i);let a=document.createElement("button");a.textContent="Zoom to Fit",a.style.padding="8px 12px",a.style.background="#4CAF50",a.style.color="white",a.style.border="none",a.style.borderRadius="4px",a.style.cursor="pointer",a.style.fontSize="14px",a.onmouseover=()=>a.style.background="#45a049",a.onmouseout=()=>a.style.background="#4CAF50",i.appendChild(a);let c=document.createElement("button");c.textContent="Export PNG",c.style.padding="8px 12px",c.style.background="#2196F3",c.style.color="white",c.style.border="none",c.style.borderRadius="4px",c.style.cursor="pointer",c.style.fontSize="14px",c.onmouseover=()=>c.style.background="#0b7dda",c.onmouseout=()=>c.style.background="#2196F3",i.appendChild(c);let{Network:u,DataSet:d}=S(),x=new d(r),v=new d(o),k=b();this.network=new u(n,{nodes:x,edges:v},k),this.network.on("stabilizationIterationsDone",()=>{this.network.setOptions({physics:{enabled:!1}})}),a.onclick=()=>{this.network&&this.network.fit({animation:{duration:300,easingFunction:"easeInOutQuad"}})},c.onclick=()=>{this.download("graph-export")},e.length>1e3&&console.warn("Large graph detected (>1000 triples). Rendering may be slow.")}catch(e){console.error("Error rendering graph:",e),this.yasr.resultsEl.innerHTML='<div style="padding: 20px; color: red;">Error rendering graph. See console for details.</div>'}}getIcon(){let e=document.createElement("span");return e.className="fas fa-project-diagram",e.setAttribute("aria-label","Graph visualization"),e}download(e="graph-export"){if(this.network)try{this.network.canvas.frame.canvas.toBlob(r=>{let o=URL.createObjectURL(r),n=document.createElement("a");n.href=o,n.download=`${e}.png`,n.click(),URL.revokeObjectURL(o)})}catch(s){console.error("Error exporting graph:",s)}}},y=h;typeof window!="undefined"&&window.Yasgui&&window.Yasgui.Yasr&&window.Yasgui.Yasr.registerPlugin("graph",y);var P=y;return $(V);})();
2
- //# sourceMappingURL=yasgui-graph-plugin.min.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../src/index.js", "../src/prefixUtils.js", "../src/networkConfig.js", "../src/parsers.js", "../src/colorUtils.js", "../src/transformers.js", "../src/GraphPlugin.js"],
4
- "sourcesContent": ["import GraphPlugin from './GraphPlugin.js';\r\n\r\n// Auto-register plugin if Yasgui is available (UMD global)\r\nif (typeof window !== 'undefined' && window.Yasgui && window.Yasgui.Yasr) {\r\n window.Yasgui.Yasr.registerPlugin('graph', GraphPlugin);\r\n}\r\n\r\nexport default GraphPlugin;\r\n", "/**\r\n * Extract namespace prefixes from SPARQL results metadata\r\n * @param {Object} yasrResults - YASR results object\r\n * @returns {Map<string, string>} Map of namespace URI to prefix\r\n */\r\nfunction extractPrefixes(yasrResults) {\r\n const prefixMap = new Map();\r\n \r\n // Check for prefixes in results metadata\r\n if (yasrResults && yasrResults.getVariables) {\r\n const vars = yasrResults.getVariables();\r\n if (vars && vars.prefixes) {\r\n Object.entries(vars.prefixes).forEach(([prefix, uri]) => {\r\n prefixMap.set(uri, prefix);\r\n });\r\n }\r\n }\r\n \r\n // Add common RDF prefixes as fallback\r\n const commonPrefixes = {\r\n 'http://www.w3.org/1999/02/22-rdf-syntax-ns#': 'rdf',\r\n 'http://www.w3.org/2000/01/rdf-schema#': 'rdfs',\r\n 'http://www.w3.org/2001/XMLSchema#': 'xsd',\r\n 'http://www.w3.org/2002/07/owl#': 'owl',\r\n };\r\n \r\n Object.entries(commonPrefixes).forEach(([uri, prefix]) => {\r\n if (!prefixMap.has(uri)) {\r\n prefixMap.set(uri, prefix);\r\n }\r\n });\r\n \r\n return prefixMap;\r\n}\r\n\r\n/**\r\n * Convert full URI to prefixed form\r\n * @param {string} uri - Full URI\r\n * @param {Map<string, string>} prefixMap - Namespace to prefix mappings\r\n * @returns {string} Prefixed URI (e.g., \"ex:Person\") or original if no match\r\n */\r\nfunction applyPrefix(uri, prefixMap) {\r\n if (!uri || typeof uri !== 'string') return uri;\r\n \r\n for (const [namespace, prefix] of prefixMap.entries()) {\r\n if (uri.startsWith(namespace)) {\r\n const localName = uri.substring(namespace.length);\r\n return `${prefix}:${localName}`;\r\n }\r\n }\r\n \r\n return uri;\r\n}\r\n\r\n/**\r\n * Truncate long labels with ellipsis\r\n * @param {string} text - Text to truncate\r\n * @param {number} maxLength - Maximum length before truncation (default: 50)\r\n * @returns {string} Truncated text with ellipsis if needed\r\n */\r\nfunction truncateLabel(text, maxLength = 50) {\r\n if (!text || typeof text !== 'string') return text;\r\n \r\n if (text.length <= maxLength) return text;\r\n \r\n return text.substring(0, maxLength - 3) + '...';\r\n}\r\n\r\nexport {\r\n extractPrefixes,\r\n applyPrefix,\r\n truncateLabel,\r\n};\r\n", "/**\r\n * Get default vis-network configuration options\r\n * @returns {Object} vis-network options object\r\n */\r\nfunction getDefaultNetworkOptions() {\r\n return {\r\n autoResize: true,\r\n width: '100%',\r\n height: '100%',\r\n \r\n physics: {\r\n enabled: true,\r\n stabilization: {\r\n enabled: true,\r\n iterations: 200, // Max iterations for performance (<2s target)\r\n updateInterval: 25,\r\n },\r\n barnesHut: {\r\n gravitationalConstant: -2000,\r\n centralGravity: 0.3,\r\n springLength: 95,\r\n springConstant: 0.04,\r\n damping: 0.09,\r\n },\r\n },\r\n \r\n interaction: {\r\n dragNodes: true,\r\n dragView: true,\r\n zoomView: true,\r\n hover: true,\r\n tooltipDelay: 300, // 300ms hover delay per spec\r\n },\r\n \r\n nodes: {\r\n shape: 'ellipse',\r\n size: 25,\r\n font: {\r\n size: 14,\r\n color: '#000000',\r\n },\r\n borderWidth: 2,\r\n borderWidthSelected: 3,\r\n },\r\n \r\n edges: {\r\n arrows: {\r\n to: {\r\n enabled: true,\r\n scaleFactor: 0.5,\r\n },\r\n },\r\n smooth: {\r\n enabled: true,\r\n type: 'dynamic',\r\n },\r\n font: {\r\n size: 12,\r\n align: 'middle',\r\n },\r\n },\r\n };\r\n}\r\n\r\nexport {\r\n getDefaultNetworkOptions,\r\n};\r\n", "/**\r\n * Parse SPARQL CONSTRUCT results to extract RDF triples\r\n * @param {Object} yasrResults - YASR results object\r\n * @returns {Array<Object>} Array of RDFTriple objects {subject, predicate, object}\r\n */\r\nfunction parseConstructResults(yasrResults) {\r\n const triples = [];\r\n \r\n if (!yasrResults || !yasrResults.getBindings) {\r\n return triples;\r\n }\r\n \r\n const bindings = yasrResults.getBindings();\r\n \r\n bindings.forEach((binding) => {\r\n if (!binding.subject || !binding.predicate || !binding.object) {\r\n return; // Skip incomplete bindings\r\n }\r\n \r\n const triple = {\r\n subject: binding.subject.value,\r\n predicate: binding.predicate.value,\r\n object: {\r\n value: binding.object.value,\r\n type: binding.object.type || 'uri',\r\n datatype: binding.object.datatype,\r\n lang: binding.object['xml:lang'],\r\n },\r\n };\r\n \r\n triples.push(triple);\r\n });\r\n \r\n return triples;\r\n}\r\n\r\nexport {\r\n parseConstructResults,\r\n};\r\n", "/**\r\n * Determine node color based on type and predicates\r\n * @param {Object} node - Node object with uri, type properties\r\n * @param {Array} triples - All RDF triples for context\r\n * @returns {string} Hex color code\r\n */\r\nfunction getNodeColor(node, triples) {\r\n // Blank nodes: yellow\r\n if (node.uri && node.uri.startsWith('_:')) {\r\n return '#e15b13ff';\r\n }\r\n \r\n // Literals: grey\r\n if (node.type === 'literal') {\r\n return '#808080';\r\n }\r\n \r\n // Check if node is object of rdf:type predicate: green\r\n const isTypeObject = triples.some(\r\n (triple) =>\r\n triple.predicate === 'http://www.w3.org/1999/02/22-rdf-syntax-ns#type' &&\r\n triple.object.value === node.uri\r\n );\r\n \r\n if (isTypeObject) {\r\n return '#068e06ff';\r\n }\r\n \r\n // Other URIs: blue\r\n return '#4949c6ff';\r\n}\r\n\r\nexport {\r\n getNodeColor,\r\n};\r\n", "import { applyPrefix, truncateLabel } from './prefixUtils.js';\r\nimport { getNodeColor } from './colorUtils.js';\r\n\r\n/**\r\n * Create deduplicated node map from triples\r\n * @param {Array} triples - RDF triples\r\n * @param {Map} prefixMap - Namespace to prefix mappings\r\n * @returns {Map<string, Object>} Map of node value to GraphNode\r\n */\r\nfunction createNodeMap(triples, prefixMap) {\r\n const nodeMap = new Map();\r\n let nodeId = 1;\r\n \r\n triples.forEach((triple) => {\r\n // Add subject node\r\n if (!nodeMap.has(triple.subject)) {\r\n const isBlankNode = triple.subject.startsWith('_:');\r\n const label = isBlankNode\r\n ? triple.subject\r\n : truncateLabel(applyPrefix(triple.subject, prefixMap));\r\n \r\n nodeMap.set(triple.subject, {\r\n id: nodeId++,\r\n uri: triple.subject,\r\n label: label,\r\n color: getNodeColor({ uri: triple.subject, type: 'uri' }, triples),\r\n type: 'uri',\r\n fullValue: triple.subject,\r\n title: isBlankNode ? triple.subject : applyPrefix(triple.subject, prefixMap),\r\n });\r\n }\r\n \r\n // Add object node\r\n const objValue = triple.object.value;\r\n if (!nodeMap.has(objValue)) {\r\n const isLiteral = triple.object.type === 'literal';\r\n const isBlankNode = !isLiteral && objValue.startsWith('_:');\r\n \r\n let label, fullValue, title;\r\n \r\n if (isLiteral) {\r\n label = truncateLabel(objValue);\r\n fullValue = objValue;\r\n title = triple.object.datatype\r\n ? `\"${objValue}\"^^${applyPrefix(triple.object.datatype, prefixMap)}`\r\n : `\"${objValue}\"`;\r\n } else if (isBlankNode) {\r\n label = objValue;\r\n fullValue = objValue;\r\n title = objValue;\r\n } else {\r\n label = truncateLabel(applyPrefix(objValue, prefixMap));\r\n fullValue = objValue;\r\n title = applyPrefix(objValue, prefixMap);\r\n }\r\n \r\n nodeMap.set(objValue, {\r\n id: nodeId++,\r\n uri: isLiteral ? null : objValue,\r\n label: label,\r\n color: getNodeColor(\r\n { uri: objValue, type: isLiteral ? 'literal' : 'uri' },\r\n triples\r\n ),\r\n type: isLiteral ? 'literal' : 'uri',\r\n fullValue: fullValue,\r\n title: title,\r\n });\r\n }\r\n });\r\n \r\n return nodeMap;\r\n}\r\n\r\n/**\r\n * Create edges array from triples\r\n * @param {Array} triples - RDF triples\r\n * @param {Map} nodeMap - Map of node values to GraphNodes\r\n * @param {Map} prefixMap - Namespace to prefix mappings\r\n * @returns {Array<Object>} Array of GraphEdge objects\r\n */\r\nfunction createEdgesArray(triples, nodeMap, prefixMap) {\r\n const edges = [];\r\n const edgeSet = new Set(); // For deduplication\r\n \r\n triples.forEach((triple) => {\r\n const fromNode = nodeMap.get(triple.subject);\r\n const toNode = nodeMap.get(triple.object.value);\r\n \r\n if (!fromNode || !toNode) return;\r\n \r\n // Create unique edge identifier for deduplication\r\n const edgeKey = `${fromNode.id}-${triple.predicate}-${toNode.id}`;\r\n \r\n if (!edgeSet.has(edgeKey)) {\r\n edgeSet.add(edgeKey);\r\n \r\n edges.push({\r\n id: `edge_${fromNode.id}_${toNode.id}_${edges.length}`,\r\n from: fromNode.id,\r\n to: toNode.id,\r\n label: truncateLabel(applyPrefix(triple.predicate, prefixMap)),\r\n predicate: triple.predicate,\r\n title: applyPrefix(triple.predicate, prefixMap),\r\n arrows: 'to',\r\n });\r\n }\r\n });\r\n \r\n return edges;\r\n}\r\n\r\n/**\r\n * Transform RDF triples to graph data structure\r\n * @param {Array} triples - RDF triples\r\n * @param {Map} prefixMap - Namespace to prefix mappings\r\n * @returns {Object} {nodes: Array, edges: Array}\r\n */\r\nfunction triplesToGraph(triples, prefixMap) {\r\n const nodeMap = createNodeMap(triples, prefixMap);\r\n const edges = createEdgesArray(triples, nodeMap, prefixMap);\r\n const nodes = Array.from(nodeMap.values());\r\n \r\n return { nodes, edges };\r\n}\r\n\r\nexport {\r\n createNodeMap,\r\n createEdgesArray,\r\n triplesToGraph,\r\n};\r\n", "import { extractPrefixes } from './prefixUtils.js';\r\nimport { getDefaultNetworkOptions } from './networkConfig.js';\r\nimport { parseConstructResults } from './parsers.js';\r\nimport { triplesToGraph } from './transformers.js';\r\n\r\n// Get vis-network (from global in dev mode, or bundled in production)\r\nfunction getVisNetwork() {\r\n if (typeof window !== 'undefined' && window.vis) {\r\n return window.vis;\r\n }\r\n // In production build, this will be bundled\r\n throw new Error('vis-network not found. Load vis-network before GraphPlugin in dev mode.');\r\n}\r\n\r\n/**\r\n * YASR plugin for visualizing SPARQL CONSTRUCT results as graphs\r\n */\r\nclass GraphPlugin {\r\n constructor(yasr) {\r\n this.yasr = yasr;\r\n this.network = null;\r\n }\r\n\r\n /**\r\n * Plugin priority (higher = shown first in tabs)\r\n */\r\n static get priority() {\r\n return 20;\r\n }\r\n\r\n /**\r\n * Plugin label for tab display\r\n */\r\n static get label() {\r\n return 'Graph';\r\n }\r\n\r\n /**\r\n * Check if plugin can handle the current results\r\n * @returns {boolean} True if results are from CONSTRUCT query\r\n */\r\n canHandleResults() {\r\n if (!this.yasr || !this.yasr.results) return false;\r\n\r\n const results = this.yasr.results;\r\n \r\n // Check if results have RDF triple structure (subject/predicate/object)\r\n if (results.getBindings && typeof results.getBindings === 'function') {\r\n const bindings = results.getBindings();\r\n if (bindings && bindings.length > 0) {\r\n const firstBinding = bindings[0];\r\n // CONSTRUCT results have subject, predicate, object variables\r\n return (\r\n firstBinding.subject !== undefined &&\r\n firstBinding.predicate !== undefined &&\r\n firstBinding.object !== undefined\r\n );\r\n }\r\n }\r\n \r\n return false;\r\n }\r\n\r\n /**\r\n * Render the graph visualization\r\n */\r\n draw() {\r\n // Clear previous content\r\n this.yasr.resultsEl.innerHTML = '';\r\n \r\n try {\r\n // Parse RDF triples from results\r\n const triples = parseConstructResults(this.yasr.results);\r\n \r\n // Handle empty results\r\n if (!triples || triples.length === 0) {\r\n this.yasr.resultsEl.innerHTML = '<div style=\"padding: 20px; text-align: center; color: #666;\">No graph data to visualize</div>';\r\n return;\r\n }\r\n \r\n // Extract prefixes\r\n const prefixMap = extractPrefixes(this.yasr.results);\r\n \r\n // Transform triples to graph data\r\n const { nodes, edges } = triplesToGraph(triples, prefixMap);\r\n \r\n // Create container\r\n const container = document.createElement('div');\r\n container.style.width = '100%';\r\n container.style.height = '600px';\r\n container.style.position = 'relative';\r\n container.style.overflow = 'hidden';\r\n this.yasr.resultsEl.appendChild(container);\r\n \r\n // Add controls container\r\n const controls = document.createElement('div');\r\n controls.style.position = 'absolute';\r\n controls.style.top = '10px';\r\n controls.style.right = '10px';\r\n controls.style.zIndex = '1000';\r\n controls.style.display = 'flex';\r\n controls.style.gap = '10px';\r\n container.appendChild(controls);\r\n \r\n // Add \"Zoom to Fit\" button\r\n const fitButton = document.createElement('button');\r\n fitButton.textContent = 'Zoom to Fit';\r\n fitButton.style.padding = '8px 12px';\r\n fitButton.style.background = '#4CAF50';\r\n fitButton.style.color = 'white';\r\n fitButton.style.border = 'none';\r\n fitButton.style.borderRadius = '4px';\r\n fitButton.style.cursor = 'pointer';\r\n fitButton.style.fontSize = '14px';\r\n fitButton.onmouseover = () => fitButton.style.background = '#45a049';\r\n fitButton.onmouseout = () => fitButton.style.background = '#4CAF50';\r\n controls.appendChild(fitButton);\r\n \r\n // Add \"Export PNG\" button\r\n const exportButton = document.createElement('button');\r\n exportButton.textContent = 'Export PNG';\r\n exportButton.style.padding = '8px 12px';\r\n exportButton.style.background = '#2196F3';\r\n exportButton.style.color = 'white';\r\n exportButton.style.border = 'none';\r\n exportButton.style.borderRadius = '4px';\r\n exportButton.style.cursor = 'pointer';\r\n exportButton.style.fontSize = '14px';\r\n exportButton.onmouseover = () => exportButton.style.background = '#0b7dda';\r\n exportButton.onmouseout = () => exportButton.style.background = '#2196F3';\r\n controls.appendChild(exportButton);\r\n \r\n // Get vis-network classes\r\n const { Network, DataSet } = getVisNetwork();\r\n \r\n // Create vis-network DataSets\r\n const nodesDataSet = new DataSet(nodes);\r\n const edgesDataSet = new DataSet(edges);\r\n \r\n // Initialize network\r\n const options = getDefaultNetworkOptions();\r\n this.network = new Network(\r\n container,\r\n { nodes: nodesDataSet, edges: edgesDataSet },\r\n options\r\n );\r\n \r\n // Disable physics after stabilization (performance optimization)\r\n this.network.on('stabilizationIterationsDone', () => {\r\n this.network.setOptions({ physics: { enabled: false } });\r\n });\r\n \r\n // Wire up button click handlers\r\n fitButton.onclick = () => {\r\n if (this.network) {\r\n this.network.fit({ animation: { duration: 300, easingFunction: 'easeInOutQuad' } });\r\n }\r\n };\r\n \r\n exportButton.onclick = () => {\r\n this.download('graph-export');\r\n };\r\n \r\n // Add performance warning for large graphs\r\n if (triples.length > 1000) {\r\n console.warn('Large graph detected (>1000 triples). Rendering may be slow.');\r\n }\r\n \r\n } catch (error) {\r\n console.error('Error rendering graph:', error);\r\n this.yasr.resultsEl.innerHTML = '<div style=\"padding: 20px; color: red;\">Error rendering graph. See console for details.</div>';\r\n }\r\n }\r\n\r\n /**\r\n * Get icon for plugin tab\r\n * @returns {Element} Icon element\r\n */\r\n getIcon() {\r\n const icon = document.createElement('span');\r\n icon.className = 'fas fa-project-diagram';\r\n icon.setAttribute('aria-label', 'Graph visualization');\r\n return icon;\r\n }\r\n\r\n /**\r\n * Download graph as PNG image\r\n * @param {string} filename - Output filename\r\n */\r\n download(filename = 'graph-export') {\r\n if (!this.network) return;\r\n \r\n try {\r\n const canvas = this.network.canvas.frame.canvas;\r\n canvas.toBlob((blob) => {\r\n const url = URL.createObjectURL(blob);\r\n const link = document.createElement('a');\r\n link.href = url;\r\n link.download = `${filename}.png`;\r\n link.click();\r\n URL.revokeObjectURL(url);\r\n });\r\n } catch (error) {\r\n console.error('Error exporting graph:', error);\r\n }\r\n }\r\n}\r\n\r\nexport default GraphPlugin;\r\n"],
5
- "mappings": "kbAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,ICKA,SAASC,EAAgBC,EAAa,CACpC,IAAMC,EAAY,IAAI,IAGtB,GAAID,GAAeA,EAAY,aAAc,CAC3C,IAAME,EAAOF,EAAY,aAAa,EAClCE,GAAQA,EAAK,UACf,OAAO,QAAQA,EAAK,QAAQ,EAAE,QAAQ,CAAC,CAACC,EAAQC,CAAG,IAAM,CACvDH,EAAU,IAAIG,EAAKD,CAAM,CAC3B,CAAC,CAEL,CAUA,cAAO,QAPgB,CACrB,8CAA+C,MAC/C,wCAAyC,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ixes", "yasrResults", "prefixMap", "vars", "prefix", "uri", "applyPrefix", "namespace", "localName", "truncateLabel", "text", "maxLength", "getDefaultNetworkOptions", "parseConstructResults", "yasrResults", "triples", "binding", "triple", "getNodeColor", "node", "triples", "triple", "createNodeMap", "triples", "prefixMap", "nodeMap", "nodeId", "triple", "isBlankNode", "label", "truncateLabel", "applyPrefix", "getNodeColor", "objValue", "isLiteral", "fullValue", "title", "createEdgesArray", "edges", "edgeSet", "fromNode", "toNode", "edgeKey", "triplesToGraph", "getVisNetwork", "GraphPlugin", "yasr", "results", "bindings", "firstBinding", "triples", "parseConstructResults", "prefixMap", "extractPrefixes", "nodes", "edges", "triplesToGraph", "container", "controls", "fitButton", "exportButton", "Network", "DataSet", "nodesDataSet", "edgesDataSet", "options", "getDefaultNetworkOptions", "error", "icon", "filename", "blob", "url", "link", "GraphPlugin_default", "GraphPlugin_default", "src_default"]
7
- }