visualizer/Filters.md
Here you can find documentation for Filter API of Ideal Graph Visualizer.
Custom filters are powerful tool which let you write your own code in JavaScript
to allow almost unbound manipulation and analysis of GraalVM graphs in Ideal Graph Visualizer.
Our Filter API comes with various prepared helper functions to speedup writing of your own filters,
helpers are written against imported classes listed below.
classSimpleName(className: string): string;colorize(propertyName: string, valueRegexp: string, color: Color);var color = new Color(r, g, b);<p> </p>colorizeGradient(propertyName: string, min: number, max: number);blue through yellow to red in linear fassion.<p> </p>colorizeGradientWithMode(propertyName: string, min: number, max: number, gradientMode: string);"LINEAR" or "LOGARITHMIC" mode.<p> </p>colorizeGradientCustom(propertyName: string, min: number, max: number, gradientMode: string, colors: Color[], fractions: number[], shades: integer);colors: used colors in order from minimal to maximal valuefractions: positions of abovementioned colors on color gradient scale (first is 0, last 1)shades: number of used color shades<p> </p>remove(propertyName: string, valueRegexp: string);removeIncludingOrphans(propertyName: string, valueRegexp: string);removeInputs(propertyName: string, valueRegexp: string, fromIndex: integer = 0, toIndex: integer = Integer.MAX_VALUE);fromIndex and toIndex denotes starting and ending index of inputs to remove<p> </p>removeUnconectedSlots(removeInputs: boolean, removeOutputs: boolean);split(propertyName: string, valueRegexp: string, nodeText: string);| Variable name | Content |
|---|---|
| black | Color.static.black |
| blue | Color.static.blue |
| cyan | Color.static.cyan |
| darkGray | Color.static.darkGray |
| gray | Color.static.gray |
| green | Color.static.green |
| lightGray | Color.static.lightGray |
| magenta | Color.static.magenta |
| orange | Color.static.orange |
| pink | Color.static.pink |
| red | Color.static.red |
| yellow | Color.static.yellow |
| white | Color.static.white |
| Variable name | Content | Description |
|---|---|---|
| IO | PrintStream | output stream |
| graph | Diagram | current graph |
Classes imported from Ideal Graph Visualizer Java codebase to allow their creation.
| JS Class | Java Class |
|---|---|
| Color | java.awt.Color |
| GraphDocument | org.graalvm.visualizer.data.GraphDocument |
| InputGraph | org.graalvm.visualizer.data.InputGraph |
| Diagram | org.graalvm.visualizer.graph.Diagram |
| Block | org.graalvm.visualizer.graph.Block |
| Figure | org.graalvm.visualizer.graph.Figure |
| FigureSource | org.graalvm.visualizer.graph.FigureSource |
| InputSlot | org.graalvm.visualizer.graph.InputSlot |
| OutputSlot | org.graalvm.visualizer.graph.OutputSlot |
| Connection | org.graalvm.visualizer.graph.Connection |
| MatcherSelector | org.graalvm.visualizer.graph.MatcherSelector |
| InvertSelector | org.graalvm.visualizer.graph.InvertSelector |
| AndSelector | org.graalvm.visualizer.graph.AndSelector |
| OrSelector | org.graalvm.visualizer.graph.OrSelector |
| PredecessorSelector | org.graalvm.visualizer.graph.PredecessorSelector |
| SuccessorSelector | org.graalvm.visualizer.graph.SuccessorSelector |
| Properties | org.graalvm.visualizer.data.Properties |
| Property | org.graalvm.visualizer.data.Property |
| PropertySelector | org.graalvm.visualizer.data.Properties$PropertySelector |
| RegexpPropertyMatcher | org.graalvm.visualizer.data.Properties$RegexpPropertyMatcher |
| EqualityPropertyMatcher | org.graalvm.visualizer.data.Properties$EqualityPropertyMatcher |
| InvertPropertyMatcher | org.graalvm.visualizer.data.Properties$InvertPropertyMatcher |
| ColorFilter | org.graalvm.visualizer.filter.ColorFilter |
| ColorRule | org.graalvm.visualizer.filter.ColorFilter$ColorRule |
| CombineFilter | org.graalvm.visualizer.filter.CombineFilter |
| ConnectionFilter | org.graalvm.visualizer.filter.ConnectionFilter |
| CustomFilter | org.graalvm.visualizer.filter.CustomFilter |
| EdgeColorIndexFilter | org.graalvm.visualizer.filter.EdgeColorIndexFilter |
| GradientColorFilter | org.graalvm.visualizer.filter.GradientColorFilter |
| RemoveFilter | org.graalvm.visualizer.filter.RemoveFilter |
| RemoveRule | org.graalvm.visualizer.filter.RemoveFilter$RemoveRule |
| RemoveInputsFilter | org.graalvm.visualizer.filter.RemoveInputsFilter |
| RemoveInputsRule | org.graalvm.visualizer.filter.RemoveInputsFilter$RemoveInputsRule |
| RemoveSelfLoopsFilter | org.graalvm.visualizer.filter.RemoveSelfLoopsFilter |
| SplitFilter | org.graalvm.visualizer.filter.SplitFilter |
| UnconnectedSlotFilter | org.graalvm.visualizer.filter.UnconnectedSlotFilter |