delph-in / delphin-viz Goto Github PK
View Code? Open in Web Editor NEWJavaScript visualizations of various DELPH-IN structures.
Home Page: http://delph-in.github.io/delphin-viz/demo/
License: MIT License
JavaScript visualizations of various DELPH-IN structures.
Home Page: http://delph-in.github.io/delphin-viz/demo/
License: MIT License
The DMRS visualisations use CSS to style the SVG which are not saved when downloaded, so the resultant image is essentially garbage.
One option is to use this approach: https://spin.atomicobject.com/2014/01/21/convert-svg-to-png/
Some comments on this option from @goodmami via email exchange:
The approach you linked appears to traverse the CSS defined on a page and embed used rules in an internal <style> element. The method from SVGCrowbar2 (the meat of which is here: https://github.com/NYTimes/svg-crowbar/blob/gh-pages/svg-crowbar-2.js#L211-L250, specifically the explicitlySetStyle() function) finds computed styles on each element and embeds those on the style attribute on the elements. The one you linked seems good for simple cases or if we might want a dynamic SVG (e.g. with javascript event handling; see here: https://www.w3.org/TR/SVG/script.html). The SVGCrowbar2 approach is good if you want a static SVG with the styles as-currently-displayed; that is, it's better if we've manually changed certain styles, such as overriding the CSS with "style" attributes on elements after the page loads.
I think the approach you found is good for our purposes.
The REST servers have a latex
value for some formats (e.g. mrs=latex
, eds=latex
, and dmrs=latex
, although support varies among the LKB and Bottlenose servers). Can this LaTeX code be requested by the user and displayed somehow? It would probably require a second request from the server for the same input string. The LaTeX code could be displayed in a tooltip (via a button like we have for "PNG" and "SVG"), or open a new tab with the TeX code as the page contents.
I think the recent change to disable the Melbourne servers has broken things. Maybe the UM grammars need to be commented from the GRAMMARS
list in demo/resources.js
, as well.
Both MRS and DMRS visualizations get clipped when saved to SVG or PNG. More specifically, DMRS only gets clipped with PNG, and the SVG for MRS isn't really clipped, but there is 0 margin to the right of the large square opening bracket (unlike the opening bracket on the left).
See #2; the example there is relevant for reproducing these issues.
The following error occurs when parsing "Adi tahu bahwa hujan sudah turun." with INDRA:
mrsData.variables[varName] is undefined
This appears to be because every EP has an argument CARDIN bool
, which seems to be a bug in the grammar (at least, the MRS is ill-formed), and bool
is not a valid variable name.
The problem is that this error causes the DMRS to fail to be displayed, although it does display if the MRS box is unchecked (it appears to just ignore the rogue roles). The MRS layout function could be a bit more robust for bad inputs like this.
I am implementing a web page that is built upon mrs.js for reimplementing the WSI interface (https://github.com/own-pt/wql/tree/demo/flask-demo).
I need to highlight the matches that are relative to the pattern that matched and I still want to keep the highlighting of all variables of same name when hovering the variable name. The problem is that the code of the event mouseleave
is harcoded to put every variable highlighted to black, overwriting my highlight of the matches. I can create a new event listener to solve this problem, but wouldn't it the be better if the code natively had this support to place the old color instead of always putting the same color?
It seems that you need V3 of d3.js (now at version 5), since some of the functions used to render dmrs have been renamed.
The demo site is served via https, but the web API requests to parsing servers use http. Modern browsers may block these "mixed content" requests, leading to opaque error messages. The solution is to (a) change the backend server to use https, and (b) switch the URLs here in resources.js
.
This was reported in delph-in/docs#41.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.