hao-lee / graphvizer Goto Github PK
View Code? Open in Web Editor NEWPreview Graphviz in real time with Sublime Text 3
License: GNU General Public License v2.0
Preview Graphviz in real time with Sublime Text 3
License: GNU General Public License v2.0
It would be nice to navigate from one part of the graph to another holding left mouse button (like in Photoshop space
button) and zoom-in zoom-out holding right mouse button (like in Photoshop z
button). Using SVG would be more useful for zooming instead of PNG.
I don't have the dot.exe location in my path, so I set the setting dot_cmd_path
to the full path of dot.exe.
{
"dot_cmd_path": "C:\\Graphviz\\bin\\dot.exe"
}
When I build, it seems the path from settings is not used. It is just calling dot
.
Output:
'dot' is not recognized as an internal or external command,
operable program or batch file.
[Finished in 57ms with exit code 1]
[shell_cmd: dot "C:\Whatever\TheName.dot" -O -Tpng]
Sublime Text 4166
Windows 10
As suggested by @pinghe
如果dot文件还未命名,则默认在image_dir 目录下生成graphviz.png,如果一旦命名了,则生成的文件名,建议和dot文件名一致。这样多文件同时编辑时不会混淆
Hi there
I am very new to HTML (have only been learning for a day or so) I watched a youtube tutorial and followed every step but the result is not the same so I guess I need someone who know a lot more about HTML than me to have a look.
.
See the screen shot attached, all i am trying to do is place an image in a table row but each time input the attached code I just get the 'loading image' icon rather than the image itself: please help.
Did you forget to git push --tags
, or are you still getting more stuff ready? 😉
How to display image in another layout instead of a new window, in sublime text 3.
Hello,
Thank you for developing this plug-in which i believe can be super helpful!
I've been going through all the steps you wrote to install and run it. Unfortunately, even though I installed it, it seems that its main functionalities do not work properly for me.
The "Open Rendered Image" command is greyed out (so I cannot run it), and the Graphvizer panel does not react to the code I write above. Any idea what I should do to fix it?
I'm running on windows 10.
Best
Paul
Basically, I'm working on a graph with ~2000 nodes and ~3000 edges.
Feeding this to graphvis natively makes it completely poop itself. dot.exe
spun using all of a core for about 10 minutes before I killed it.
Right now, every time I save the file in the editor, it re-spawns dot.
It'd be nice if there was a way to say "if dot takes more then n seconds, just kill it".
I installed Graphvizer Viewer and could open by running python GraphvizerViewer.py
. However, how can I open png in the GraphvizerViewer window?
When Graphvizer is installed on Sublime Text 4, indexing fails to find any symbols in any file disabling "Go to Definition" and for some reason theme selection in the menu is also greyed out.
Lexical Error: line 2, column 2: token recognition error at: '中'
是否是antlr4解析默认ascii的问题?
It would really great if we could have direct support for PlantUML
.
@startuml
@enduml
Problem: Graphvizer does not render new images on edit, save, or build on a fresh installation.
Sublime Console Output on Startup:
DPI mode: per-monitor v2
startup, version: 3211 windows x64 channel: stable
executable: /C/Program Files/Sublime Text 3/sublime_text.exe
working dir: /C/Program Files/Sublime Text 3
packages path: /C/Users/../AppData/Roaming/Sublime Text 3/Packages
state path: /C/Users/../AppData/Roaming/Sublime Text 3/Local
zip path: /C/Program Files/Sublime Text 3/Packages
zip path: /C/Users/../AppData/Roaming/Sublime Text 3/Installed Packages
ignored_packages: ["Vintage"]
pre session restore time: 0.098884
startup time: 0.143884
first paint time: 0.145884
reloading plugin Default.arithmetic
reloading plugin Default.auto_indent_tag
reloading plugin Default.block
reloading plugin Default.colors
reloading plugin Default.comment
reloading plugin Default.convert_color_scheme
reloading plugin Default.convert_syntax
reloading plugin Default.copy_path
reloading plugin Default.detect_indentation
reloading plugin Default.echo
reloading plugin Default.exec
reloading plugin Default.fold
reloading plugin Default.font
reloading plugin Default.goto_line
reloading plugin Default.history_list
reloading plugin Default.indentation
reloading plugin Default.install_package_control
reloading plugin Default.kill_ring
reloading plugin Default.mark
reloading plugin Default.new_templates
reloading plugin Default.open_context_url
reloading plugin Default.open_in_browser
reloading plugin Default.pane
reloading plugin Default.paragraph
reloading plugin Default.paste_from_history
reloading plugin Default.profile
reloading plugin Default.quick_panel
reloading plugin Default.rename
reloading plugin Default.run_syntax_tests
reloading plugin Default.save_on_focus_lost
reloading plugin Default.scroll
reloading plugin Default.set_unsaved_view_name
reloading plugin Default.settings
reloading plugin Default.show_scope_name
reloading plugin Default.side_bar
reloading plugin Default.sort
reloading plugin Default.switch_file
reloading plugin Default.symbol
reloading plugin Default.transform
reloading plugin Default.transpose
reloading plugin Default.ui
reloading plugin CSS.css_completions
reloading plugin Diff.diff
reloading plugin HTML.encode_html_entities
reloading plugin HTML.html_completions
reloading plugin ShellScript.ShellScript
reloading plugin 0_package_control_loader.00-package_control
reloading plugin 0_package_control_loader.50-enum
reloading plugin 0_package_control_loader.50-typing
reloading plugin Graphvizer.graphvizer
reloading plugin Graphvizer.syntaxchecker
reloading plugin Package Control.1_reloader
reloading plugin Package Control.2_bootstrap
reloading plugin Package Control.Package Control
plugins loaded
Exception in thread Thread-1:
Traceback (most recent call last):
File "./python3.3/subprocess.py", line 1104, in _execute_child
PermissionError: [WinError 5] Access is denied
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "./python3.3/threading.py", line 901, in _bootstrap_inner
File "./python3.3/threading.py", line 858, in run
File "C:\Users\..\AppData\Roaming\Sublime Text 3\Installed Packages\Graphvizer.sublime-package\graphvizer.py", line 112, in dot_thread
cwd=self.get_cwd(view))
File "./python3.3/subprocess.py", line 819, in __init__
File "./python3.3/subprocess.py", line 1110, in _execute_child
PermissionError: [WinError 5] Access is denied
Package Control: Skipping automatic upgrade, last run at 2020-09-30 14:01:13, next run at 2020-09-30 15:01:13 or after
Versions
Windows 10 x64 (1903)
Sublime V3.2.2 (3211)
Python3 V3.8.6
Graphviz V2.44.1 (20200629.0800)
Process
0. A recent copy of Python3 and GraphViz are installed and were previously added to my system path.
// Settings in here override those in the left side
{
"dot_cmd_path": "C:\Program Files (x86)\GraphViz\bin",
"show_image_with": "tab",
}
digraph example {
node1 [
shape=record,
label="<f0> test"
];
node1:f0->a;
a->b->c;
b->e;
}
Hi hao-lee,
Excellent initiative! I've been dreaming of something like this for ages. I tried to install it on my Mac (High Sierra 10.13.6). The Graph does not get displayed.
I though it might be a permissions issue for the temporary folder, so I created a specific temp folder in the user settings, but Graphvizer is still trying to access the system temp folder.
my 'dot' is on the path, I can type 'dot - v' in the Terminal and I get a version.
Would love to get this working on my machine.
Thanks,
Andrew Magerman
As suggested by @pinghe
另外,更新配置项后,不能实时生效,需要重启sublimetext
It seems that UTF8 text is not supported.
graph {
图
}
and the error in console:
[2020-03-24 11:56:51] - Lexical Error: line 2, column 1: token recognition error at: '图'
Hi,
Thank you so much for this wonderful plugin! :-)
I have a feature request, that hopefully would add value.
Would it be possible to also render custom images? I think the screen shot below describe it best, but at a high level, I have some custom images I like to use for nodes, and it would be helpful if they also rendered in the previewer.
digraph G {
compound = true;
label = "Machine Architecture";
labelloc = "t";
fontsize = 30;
{
node [shape=box];
Machine0 [label = "", penwidth=0, shapefile="pc.png", width=0.5, height=0.5, fixedsize="true"];
MachineX [label = "MachineX"];
MachineY [label = "MachineY"];
}
{
rank = same;
MachineX MachineY;
}
Machine0 -> MachineX -> MachineY;
}
Hi,
I don't know if I am just blind but I would really enjoy being able to set where the resulting image is saved.
I am having problems running my dot script in the Terminal. But Sublime + Graphvizer work perfectly, so it would be great to not have to deal with the tmp-directory or the Terminal but just save it where I need it.
Thank you for the great package!
Instead of separate links in the Menu for "Settings - Default" and "Settings - User," do this:
I am not sure about doing it for Keymap, though. I think Keymap is global.
I have pretty big graph and it took much time to generate image. The ability to generate only on save or on another event may be pretty helpful.
系统:win10
版本:st3
如果输入一个错误的属性值,日志输出面板打印的错误信息是字节数组,而非字符串。
例如:
[2020-03-04 20:37:59] - [87, 97, 114, 110, 105, 110, 103, 58, 32, 65, 114, 114, 111, 119, 32, 116, 121, 112, 101, 32, 34, 115, 34, 32, 117, 110, 107, 110, 111, 119, 110, 32, 45, 32, 105, 103, 110, 111, 114, 105, 110, 103, 13, 10]
我尝试解决了一下,应该跟 subprocess 库的 communicate 函数返回值处理有关。
我改了下面的代码:
if len(stdout) != 0:
self.print(stdout.decode().strip())
if len(stderr) != 0:
self.print(stderr.decode().strip())
修改之后,日志打印正常:
[2020-03-04 21:25:43] - Warning: Arrow type "s" unknown - ignoring
Hello!
Thank you for great package, it's very convenient and really saves a lot of time for me!
There's one problem though: if you make a lot of frequent changes the rendering queue is being overflowed because package tends to render EACH of the intermediate changes. You can easily simulate this issue by adding a node with label and starting furiously clapping on random keys adding symbols to label. At some moment sublime text starts responding very slowly (see attached gif). I can live with ST being a bit slow but if the diagram is big, it just freezes and I have to restart it.
I've provided a simple solution below. Adding these two lines of code we tell rendering thread to only process the most recent change, skipping all the intermediate ones (which is exactly what we expect from it). It works for me, ST no longer freezes.
I don't mind if you find another solution, it's the solving of the issue what I am concerned about.
Thank you!
Same situation after this fix applied:
Solution:
def dot_thread(self):
while True:
while self.queue_rendering.qsize() > 1: # added line 1
self.queue_rendering.get() # added line 2
contents = self.queue_rendering.get(block=True, timeout=None)
Graphvizer Installation? Done!
Set the language to Graphviz(dot)? Done!
Digraph G {
123
}
CTRL+SHIFT+G
"Image has not been rendered" WHY?
Hi!
Plugin often crashes lately with the following output in the console:
indexing [job 63]: no files were indexed out of the 54 queued, abandoning crawl
Exception in thread Thread-2:
Traceback (most recent call last):
File "/Users/***/Library/Application Support/Sublime Text 3/Packages/Graphvizer/graphvizer.py", line 72, in dot_thread
stdout, stderr = process.communicate(timeout=self.dot_timeout)
File "./python3.3/subprocess.py", line 920, in communicate
File "./python3.3/subprocess.py", line 1556, in _communicate
File "./python3.3/subprocess.py", line 1644, in _communicate_with_poll
File "./python3.3/subprocess.py", line 946, in _check_timeout
subprocess.TimeoutExpired: Command '['dot', '/var/folders/0y/m29sdh053119js5w5rtg58740000gn/T/graphvizer.dot', '-Tpng', '-o', '/var/folders/0y/m29sdh053119js5w5rtg58740000gn/T/graphvizer.png']' timed out after 3 seconds
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "./python3.3/threading.py", line 901, in _bootstrap_inner
File "./python3.3/threading.py", line 858, in run
File "/Users/***/Library/Application Support/Sublime Text 3/Packages/Graphvizer/graphvizer.py", line 73, in dot_thread
except TimeoutExpired:
NameError: global name 'TimeoutExpired' is not defined
I guess changing except TimeoutExpired:
to except subprocess.TimeoutExpired:
will fix the issue
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.