Giter VIP home page Giter VIP logo

graphviz-treevisualize-weka-package's Introduction

graphviz-treevisualize-weka-package

TreeVisualize plugin for the Explorer using GraphViz (http://www.graphviz.org/) to generate the tree.

By default, the plugin expects the dot executable to be available on the system path. If that should not be the case, you can specify the correct location in the GraphVizTreeVisualization.props properties file.

Simply create the following file:

  • Linux/Mac
    $HOME/wekafiles/props/GraphVizTreeVisualization.props
    

`

  • Windows
    %USERPROFILE%\wekafiles\props\GraphVizTreeVisualization.props
    

And add the following content (adjust path, of course):

  • Linux/Mac

    Executable=/some/where/dot
    
  • Windows

    Executable=C:/Progam Files/some/where/dot.exe
    

Additional options for the executable can be specified with the AdditionalOptions property in the same properties file.

GraphVizTreeVisualization.props

Explanation of parameters:

  • Executable -- the path to the executable, if not on the system path
  • AdditionalOptions -- additional options to supply to the dot executable
  • ImageExtension -- comma-separated list of image extensions to offer in the save dialog
  • Debug -- whether to output debugging information
  • CleanUpTempFiles -- whether to clean up temporary files
  • DialogWidth -- the default width of the dialog displaying the graph
  • DialogHeight -- the default height of the dialog displaying the graph

Releases

Troubleshooting

You can use the 2014.8.1 release with Weka 3.8.1 or 3.9.1, but you need to create the GraphVizTreeVisualization.props properties file in the location explained above and add the following parameter to it (you may also have to add the Executable parameter):

AdditionalOptions=-Tpng

The new class loading mechanism in these Weka releases prevents the properties file from being loaded and graphviz not getting an output type parameter in its command-line, resulting in outputting the graph data again (which of course will fail to load as an image, see issue #3).

How to use packages

For more information on how to install the package, see:

https://waikato.github.io/weka-wiki/packages/manager/

Maven

Add the following dependency in your pom.xml to include the package:

    <dependency>
      <groupId>com.github.fracpete</groupId>
      <artifactId>graphviz-treevisualize-weka-package</artifactId>
      <version>2022.4.13</version>
      <type>jar</type>
      <exclusions>
        <exclusion>
          <groupId>nz.ac.waikato.cms.weka</groupId>
          <artifactId>weka-dev</artifactId>
        </exclusion>
      </exclusions>
    </dependency>

Screenshots

Plugin menu

plugin menu

Show graph

For the displaying the graph as an image:

show graph

Save graph data

Allows you to save the graph as .dot text file:

save graph data

Save graph image

Allows you to save the graph as PNG image:

save graph image

Export graph

Here you can export the graph as PDF, Postscript or encapsulated Postscript:

export graph

graphviz-treevisualize-weka-package's People

Contributors

fracpete avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

thuzarwin

graphviz-treevisualize-weka-package's Issues

Saving dot file option.

Was the option to save the dot file of the graph removed in the latest release? It really helped in editing the visualization (adding color, changing variable names, etc.).

visualizer not working in Weka

Hi,
The visualizer is not working for me in Weka.
I already created the $HOME/wekafiles/props/GraphVizTreeVisualization.props with the content Executable=/usr/bin/dot, and I guess I followed all the instructions steps in the README file.

My OS is Ubuntu 14.04 and I'm using Weka 3-8-1.

That's the error that appears in the terminal window when I try to use the visualizer for a decision tree:

Exception in thread "AWT-EventQueue-0" java.lang.IllegalArgumentException: Width (-1) and height (-1) cannot be <= 0
	java.awt.image.DirectColorModel.createCompatibleWritableRaster(DirectColorModel.java:1016)
	java.awt.image.BufferedImage.<init>(BufferedImage.java:333)
	weka.gui.visualize.plugins.GraphVizTreeVisualization.toBufferedImage(GraphVizTreeVisualization.java:167)
	weka.gui.visualize.plugins.GraphVizPanel.setDotty(GraphVizPanel.java:63)
	weka.gui.visualize.plugins.GraphVizTreeVisualizationPlugin$1.actionPerformed(GraphVizTreeVisualizationPlugin.java:64)
	javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022)
	javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2348)
	javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
	javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
	javax.swing.AbstractButton.doClick(AbstractButton.java:376)
	javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:833)
	javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:877)
	java.awt.Component.processMouseEvent(Component.java:6533)
	javax.swing.JComponent.processMouseEvent(JComponent.java:3324)
	java.awt.Component.processEvent(Component.java:6298)
	java.awt.Container.processEvent(Container.java:2236)
	java.awt.Component.dispatchEventImpl(Component.java:4889)
	java.awt.Container.dispatchEventImpl(Container.java:2294)
	java.awt.Component.dispatchEvent(Component.java:4711)
	java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4888)
	java.awt.LightweightDispatcher.processMouseEvent(Container.java:4525)
	java.awt.LightweightDispatcher.dispatchEvent(Container.java:4466)
	java.awt.Container.dispatchEventImpl(Container.java:2280)
	java.awt.Window.dispatchEventImpl(Window.java:2746)
	java.awt.Component.dispatchEvent(Component.java:4711)
	java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
	java.awt.EventQueue.access$500(EventQueue.java:97)
	java.awt.EventQueue$3.run(EventQueue.java:709)
	java.awt.EventQueue$3.run(EventQueue.java:703)
	java.security.AccessController.doPrivileged(Native Method)
	java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
	java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:90)
	java.awt.EventQueue$4.run(EventQueue.java:731)
	java.awt.EventQueue$4.run(EventQueue.java:729)
	java.security.AccessController.doPrivileged(Native Method)
	java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
	java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
	java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
	java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
	java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
	java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
	java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
	java.awt.EventDispatchThread.run(EventDispatchThread.java:82)

	at java.awt.image.DirectColorModel.createCompatibleWritableRaster(DirectColorModel.java:1016)
	at java.awt.image.BufferedImage.<init>(BufferedImage.java:333)
	at weka.gui.visualize.plugins.GraphVizTreeVisualization.toBufferedImage(GraphVizTreeVisualization.java:167)
	at weka.gui.visualize.plugins.GraphVizPanel.setDotty(GraphVizPanel.java:63)
	at weka.gui.visualize.plugins.GraphVizTreeVisualizationPlugin$1.actionPerformed(GraphVizTreeVisualizationPlugin.java:64)
	at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022)
	at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2348)
	at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
	at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
	at javax.swing.AbstractButton.doClick(AbstractButton.java:376)
	at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:833)
	at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:877)
	at java.awt.Component.processMouseEvent(Component.java:6533)
	at javax.swing.JComponent.processMouseEvent(JComponent.java:3324)
	at java.awt.Component.processEvent(Component.java:6298)
	at java.awt.Container.processEvent(Container.java:2236)
	at java.awt.Component.dispatchEventImpl(Component.java:4889)
	at java.awt.Container.dispatchEventImpl(Container.java:2294)
	at java.awt.Component.dispatchEvent(Component.java:4711)
	at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4888)
	at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4525)
	at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4466)
	at java.awt.Container.dispatchEventImpl(Container.java:2280)
	at java.awt.Window.dispatchEventImpl(Window.java:2746)
	at java.awt.Component.dispatchEvent(Component.java:4711)
	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
	at java.awt.EventQueue.access$500(EventQueue.java:97)
	at java.awt.EventQueue$3.run(EventQueue.java:709)
	at java.awt.EventQueue$3.run(EventQueue.java:703)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:90)
	at java.awt.EventQueue$4.run(EventQueue.java:731)
	at java.awt.EventQueue$4.run(EventQueue.java:729)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)

Any tips to solve this problem?

Thank you.

Crashes Weka when exporting to pdf

The add-in works fine for me until I export the graph as a pdf. It does export it, but it locks up Weka and all its windows to where I need to end the process in the task manager.

Weka v3.9.6
graphviz-treevisualize v2018.5.13 for 3.9.1+
Windows 10 64 bit

Thank you for your work in putting this together - it has helped me immensely!

It Is not compatible

On Windows 10, using Weka 3.8.6, it doesn't even load the package according to the console window, It says:
[WekaPackageManager] Skipping package graphviz-treevisualize because it is not compatible with Weka 3.8.6

GraphViz: Blank window in Weka

I already installed the GraphViz, but when I run the visualizer in Weka, nothing happens. It just show a blank window. I have already installed the prefuse visualization toolkit too and it worked perfectly. But i would like to run the GraphViz too, because it seems better to print.

What could I do to solve this problem?

Thank you

Does not work

On windows 7, using Weka 3.7, on clicking the plugins>graphvis visualisation option in the explorer window, an empty window appears without the visualisation.

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.