Changeset 1593695
- Timestamp:
- 02/11/2017 03:52:41 AM (9 years ago)
- Location:
- tfo-graphviz/trunk
- Files:
-
- 4 edited
-
readme.txt (modified) (4 diffs)
-
tfo-graphviz-admin.php (modified) (2 diffs)
-
tfo-graphviz-method.php (modified) (1 diff)
-
tfo-graphviz.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
tfo-graphviz/trunk/readme.txt
r1593680 r1593695 1 1 === TFO Graphviz === 2 2 Contributors: chrisy 3 Tags: graphviz, flirble, network, diagram, graph, dot, neato, twopi, circo, fdp, visualisation, visualization, layout, hierarchical 3 Tags: graphviz, flirble, network, diagram, graph, dot, neato, twopi, circo, fdp, visualisation, visualization, layout, hierarchical, graph, digraph, svg 4 4 Requires at least: 4.2.0 5 5 Tested up to: 4.7.2 … … 30 30 Where `<options>` is anything from this list. All are entirely optional: 31 31 32 * `class="*`<css_class>`*"` 33 34 Adds an extra CSS class name (or names) to the `img` tag of the rendered graph. This is in addition to the 35 `graphviz` class that is already applied. 36 37 * `emitjs="yes|no"` 38 39 Override the global setting that controls whether JavaScript is emitted as necessary. Typically this JavaScript is 40 only produced when rendering SVG output and is intended to ensure SVG images work on most browsers. However this can 41 sometimes be undesirable and thus this option gives some control over this. 42 32 43 * `height="*`<image_height>`*"` 33 44 … … 152 163 = Can I manipulate the rendered graph using CSS in my WordPress theme? = 153 164 154 The `img` elements are tagged with '`class="graphviz"`'. 165 The `img` elements are tagged with '`class="graphviz"`'. Additionally, you can add `class="myclass"` to the shortcode to add additional classes to the `img` tag. 166 167 = How can I make my graph have a transparent background? 168 169 Add the tag `bgcolor="transparent"` to the root graph node. For example placing `graph [bgcolor="transparent"]` near the top like this: 170 171 ` 172 [graphviz] 173 digraph test { 174 graph [bgcolor="transparent"] 175 a1 -> a2 -> a3 -> a1; 176 } 177 [/graphviz] 155 178 156 179 = Nothing is being rendered, maybe my DOT is broken? = … … 244 267 == Changelog == 245 268 269 = 1.16 = 270 * Add `class` attribute to the shortcode to enable adding CSS classes to the `img` tag. 271 * Make the test graph on the admin page have a transparent background. 272 * Document `emitjs` attribute. 273 246 274 = 1.15 = 247 275 * Validate graph language and output format. -
tfo-graphviz/trunk/tfo-graphviz-admin.php
r1286738 r1593695 192 192 @unlink(TFO_GRAPHVIZ_CONTENT_DIR . '/test.png'); 193 193 194 $graphviz_object = $this->graphviz('digraph test { a1 -> a2 -> a3 -> a1; }', array(194 $graphviz_object = $this->graphviz('digraph test { graph [bgcolor="transparent"] a1 -> a2 -> a3 -> a1; }', array( 195 195 'id' => 'test', 196 196 'lang' => 'dot', … … 379 379 <td class="syntax"> 380 380 <p><?php printf( __( 'Use the shortcode syntax %s to insert graphs into your posts.', 'tfo-graphviz' ), 381 '<code>[graphviz]digraph test { a1 -> a2 -> a3 -> a1; }[/graphviz]</code>'381 '<code>[graphviz]digraph test { graph [bgcolor="transparent"] a1 -> a2 -> a3 -> a1; }[/graphviz]</code>' 382 382 ); ?></p> 383 383 <p><?php _e( 'For more information, see the <a href="http://blog.flirble.org/projects/tfo-graphviz/">FAQ</a>' ); ?></p> -
tfo-graphviz/trunk/tfo-graphviz-method.php
r1286864 r1593695 43 43 function __construct($dot, $atts) { 44 44 $this->dot = (string) $dot; 45 foreach (array('id', 'lang', 'simple', 'output', 'href', 'imap', 'title', 'size', 'dpi' ) as $att) {45 foreach (array('id', 'lang', 'simple', 'output', 'href', 'imap', 'title', 'size', 'dpi', 'emitjs', 'class') as $att) { 46 46 if (array_key_exists($att, $atts)) 47 47 $this->$att = $atts[$att]; -
tfo-graphviz/trunk/tfo-graphviz.php
r1593680 r1593695 176 176 'dpi' => '', 177 177 'emitjs' => TFO_GRAPHVIZ_EMITJS, 178 'class' => '', 178 179 ), $_atts); 179 180 … … 247 248 } 248 249 $alt = esc_attr($gv->title); 249 $ret = "<img src=\"$url\" class=\"graphviz\""; 250 $ret = "<img src=\"$url\" class=\"graphviz"; 251 if (!empty($atts['class'])) $ret .= " ".esc_attr($atts['class']); 252 $ret .= "\""; 250 253 if (!empty($alt)) $ret .= " alt=\"$alt\" title=\"$alt\""; 251 254 if (!empty($gv->imap)) $ret .= " usemap=\"#$gv->id\"";
Note: See TracChangeset
for help on using the changeset viewer.