-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Convert Cytoscape.js JSON style file to Cytoscape XML style file #1
Comments
@adbharadwaj @rishabhsethi Should we consider this functionality in CyGraphSpace? |
Sorry. I see that Jeff opened this bug in CyGraphSpace! |
There are two ways to solve this problem.
OPTION 1 - implement the logic to import style file in JSON format in
CyGraphSpace.
OPTION 2 - implement the logic to export style file in XML format in
Graphspace.
I would choose option 1. This will be a great feature to have in
CyGraphSpace.
In order to find out how to parse Json style files in CyGraphSpace code, we
need to read through Cytoscape code for importing graph structure from Json
file and Cytoscape code for importing style from XML file. My intuition is
that they will have a class for style and all we need to do is implement a
function that will parse Json style files and creates an object of this
style class.
On Jun 8, 2017 12:44 AM, "T. M. Murali" <notifications@github.com> wrote:
@adbharadwaj <https://github.com/adbharadwaj> @rishabhsethi
<https://github.com/rishabhsethi> Should we consider this functionality in
CyGraphSpace?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ADUeBwyHD7XwXIvp8pPqk2eWaXDQLIfuks5sBvaXgaJpZM4NzIzO>
.
|
Cytoscape should have an API to add style to the graph manually. So we should be able to parse the JSON file and add the style parameters. I'll try to implement this and get back. |
@rishabhsethi Thanks for offering to implement this functionality. You do not need to work on this issue right away. I suggest you add it to your timeline sometime later in the summer. Getting the core functionality implemented first is more important. |
According to the Cytoscape documentation for Style File Formats, Cytoscape can export XML style files and Cytoscape.js compatible JSON style files, but only imports XML style files.
I suspect a good place to start for syncing graphs between Cytoscape and GraphSpace would be to create a script (in Java) which converts the JSON style file to an XML style file. That would enable a user to manually download a graph and style from GraphSpace, convert it to XML and then import the graph and style files to Cytoscape.
That same Java code could then be used to convert the styles internally for the app.
The text was updated successfully, but these errors were encountered: