Giter VIP home page Giter VIP logo

discourse-d3-graphviz's People

Contributors

magjac avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Forkers

arkshine

discourse-d3-graphviz's Issues

Graph preview stops updating after editing

systematic reproduction sequence, happens in both Chrome and Firefox

  1. Copy paste following empty text in post
[dot]
[code]

[/code]
[/dot]

I think, from there onward, the preview engine is broken, to prove that in two steps
2. copy paste the dot graph inside the previously pasted blocks

digraph G {
node [shape=rect];

subgraph cluster_0 {
style=filled;
color=lightgrey;
node [style=filled,color=white];
a0 -> a1 -> a2 -> a3;
label = "Hello";
}

subgraph cluster_1 {
node [style=filled];
b0 -> b1 -> b2 -> b3;
label = "World";
color=blue
}

start -> a0;
start -> b0;
a1 -> b3;
b2 -> a3;
a3 -> a0;
a3 -> end;
b3 -> end;

start [shape=Mdiamond];
end [shape=Msquare];
}

nothing appears on the preview, now last step to show that it has nothing to do with what entered, without touching the edited content, open the middle mouse click on the post page link to

  1. open the same post page in a new browser window : The preview appears correctly

So a workaround until this is solved is

  • Do not type your graph step by step by hand on the post edit with preview window, unless you're aware of the issue and not care about the preview
  • do not create an empty graph items
  • copy paste the whole characters at once in the edit window [dot][code]graph_text[/code][/dot]

examples :
browser page in a broken state
image

new browser window
image

  • reproduced on : Firefox 77.0.1 (64-bit) / Chrome Version 83.0.4103.97 (Official Build) (64-bit)

Animations break after page not being visible

The animated transitions becomes incorrect after events such as:

  • Visiting another tab in the browser
  • Minimizing the browser

The console shows error messages like:

  • TypeError: d is undefined ... render.js:52:14
  • TypeError: undefined has no properties ... render.js:52:14
  • TypeError: Cannot read property 'key' of undefined ... render.js:52:14

The referenced line is https://github.com/magjac/d3-graphviz/blob/cad62e703d51729d7ec5c5c323fc8abb550b6802/src/render.js#L52

acquiring mouse wheel events might be undesirable

Hi,
I used this theme component in this post
https://forum.graphviz.org/t/d3-graphviz-monitoring-a-smart-home-zigbee-network/180

  1. edit preview
    and I some of the issues I had is that the post edit preview did not show the rendered graph, which is not a big deal in itself. I don't remember if the first time on another post, the preview did work or not, but independent from myself, this might lead any user to think that the theme component is not working unless the info is known that the rendering is not to be expected in the post edit preview window.
    I had many other points but partly covered with

an additional one is the

  1. user focus
    when scrolling with post with the mouse, and the mouse hits the rendered graph, it steels the mouse wheel focus and start zooming in or out, which is not expected by the user and might decrease the forum usage experience.
    One possibility I can think of is to keep the graph passive by default, maybe a highlight on hover to give a hint about potential interactivity, and then give the focus to the mouse on click, not simply on hover or move.
    I think menu buttons to enable / disable the source code (verbose mode) could be helpful, as whatever the user sets, another viewer could expect it the other way around. even an export svg could be thought of.

The whole graph is not always visible during animation if the width increases

The width is also increased through an animated transition. I some cases the rightmost parts of the graph may fade in while temporarily being outside the visible area.

A solution could be to set the SVG width to the same as the rest of the paragraph.

Example of such DOT sources:

[dot]
digraph {
a -> b
}
[/dot]
[dot]
digraph {
a -> b
a -> c
}
[/dot]
[dot]
digraph {
a -> b
a -> c
b -> c
}
[/dot]

Discourse shows error message for posts using `[dot]` and no graph is shown.

Instead, the text is shown without any interpretation.

image

This problem actually started to happen with a new Discourse version introduced just before 2021-04-13. At that time Discourse showed no error message and rendered nothing in the posts if the discourse-d3-graphviz theme component was used.

At the Graphviz forum, this was discovered 2021-04-13 and then the theme component was simply disabled.

Unfortunately there were other users that were affected by this too. See https://meta.discourse.org/t/d3-graphviz-theme-component/153031/2.

Add support for disabling animations while editing

Today, it's possible to stop the animated transition in the editor, but as soon as you start typing it starts again. This can be quite annoying. All animations shall be paused when the editor is opened and resumed when closed.

Pause transitions when graph is not visible

The animated transitions can sometimes be quite CPU intensive. When the graph is not visible there's no need to continue doping them.

Cases that should be handled:

  • The browser window is minimized
  • The browser tab is not visible
  • The graph has been scrolled out of the visible area

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.