dot: add option C(COLOR)

This fixes the output gliches visible in the previous patches,
where highlighting a state would remove its fill color.

* spot/twaalgos/dot.cc, spot/taalgos/dot.cc: Implement option C(COLOR).
* bin/common_aoutput.cc, doc/org/oaut.org: Document it.
* doc/org/.dir-locals.el.in, doc/org/init.el.in,
python/spot/__init__.py: Use it.
* tests/python/automata-io.ipynb, tests/python/automata.ipynb,
tests/python/highlighting.ipynb: Test it.
* tests/core/readsave.test: Adjust.
* NEWS: Mention recent changes.
This commit is contained in:
Alexandre Duret-Lutz 2016-02-05 18:56:08 +01:00
parent 23c2cbf46a
commit 77b0b5b3fe
12 changed files with 163 additions and 107 deletions

View file

@ -17,7 +17,8 @@
"pygments_lexer": "ipython3",
"version": "3.4.3+"
},
"name": ""
"name": "",
"signature": "sha256:93ecf5f37287bb2a03dcd63d41faa06f0ed9d8bcc403c73b24d1bf10404b3b1c"
},
"nbformat": 3,
"nbformat_minor": 0,
@ -177,7 +178,7 @@
"</svg>\n"
],
"text": [
"<spot.impl.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7f3c25174540> >"
"<spot.impl.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7f7cfc093810> >"
]
}
],
@ -211,7 +212,7 @@
"<!-- I -->\n",
"<!-- 0 -->\n",
"<g class=\"node\" id=\"node2\"><title>0</title>\n",
"<ellipse cx=\"120.356\" cy=\"-287\" fill=\"#ffffaa\" rx=\"18\" ry=\"18\" stroke=\"black\"/>\n",
"<ellipse cx=\"120.356\" cy=\"-287\" fill=\"none\" rx=\"18\" ry=\"18\" stroke=\"black\"/>\n",
"<text font-family=\"Times,serif\" font-size=\"14.00\" text-anchor=\"middle\" x=\"120.356\" y=\"-283.3\">0</text>\n",
"</g>\n",
"<!-- I&#45;&gt;0 -->\n",
@ -227,7 +228,7 @@
"</g>\n",
"<!-- 1 -->\n",
"<g class=\"node\" id=\"node3\"><title>1</title>\n",
"<ellipse cx=\"67.3561\" cy=\"-196\" fill=\"#ffffaa\" rx=\"18\" ry=\"18\" stroke=\"black\"/>\n",
"<ellipse cx=\"67.3561\" cy=\"-196\" fill=\"none\" rx=\"18\" ry=\"18\" stroke=\"black\"/>\n",
"<ellipse cx=\"67.3561\" cy=\"-196\" fill=\"none\" rx=\"22\" ry=\"22\" stroke=\"black\"/>\n",
"<text font-family=\"Times,serif\" font-size=\"14.00\" text-anchor=\"middle\" x=\"67.3561\" y=\"-192.3\">1</text>\n",
"</g>\n",
@ -239,7 +240,7 @@
"</g>\n",
"<!-- 4 -->\n",
"<g class=\"node\" id=\"node4\"><title>4</title>\n",
"<ellipse cx=\"175.356\" cy=\"-196\" fill=\"#ffffaa\" rx=\"18\" ry=\"18\" stroke=\"black\"/>\n",
"<ellipse cx=\"175.356\" cy=\"-196\" fill=\"none\" rx=\"18\" ry=\"18\" stroke=\"black\"/>\n",
"<text font-family=\"Times,serif\" font-size=\"14.00\" text-anchor=\"middle\" x=\"175.356\" y=\"-192.3\">4</text>\n",
"</g>\n",
"<!-- 0&#45;&gt;4 -->\n",
@ -256,7 +257,7 @@
"</g>\n",
"<!-- 2 -->\n",
"<g class=\"node\" id=\"node5\"><title>2</title>\n",
"<ellipse cx=\"68.3561\" cy=\"-18\" fill=\"#ffffaa\" rx=\"18\" ry=\"18\" stroke=\"black\"/>\n",
"<ellipse cx=\"68.3561\" cy=\"-18\" fill=\"none\" rx=\"18\" ry=\"18\" stroke=\"black\"/>\n",
"<text font-family=\"Times,serif\" font-size=\"14.00\" text-anchor=\"middle\" x=\"68.3561\" y=\"-14.3\">2</text>\n",
"</g>\n",
"<!-- 1&#45;&gt;2 -->\n",
@ -267,7 +268,7 @@
"</g>\n",
"<!-- 3 -->\n",
"<g class=\"node\" id=\"node6\"><title>3</title>\n",
"<ellipse cx=\"68.3561\" cy=\"-105\" fill=\"#ffffaa\" rx=\"18\" ry=\"18\" stroke=\"black\"/>\n",
"<ellipse cx=\"68.3561\" cy=\"-105\" fill=\"none\" rx=\"18\" ry=\"18\" stroke=\"black\"/>\n",
"<text font-family=\"Times,serif\" font-size=\"14.00\" text-anchor=\"middle\" x=\"68.3561\" y=\"-101.3\">3</text>\n",
"</g>\n",
"<!-- 1&#45;&gt;3 -->\n",
@ -316,7 +317,7 @@
"</svg>"
],
"text": [
"<IPython.core.display.SVG object>"
"<IPython.core.display.SVG at 0x7f7cff347ef0>"
]
}
],
@ -469,7 +470,7 @@
"</svg>"
],
"text": [
"<IPython.core.display.SVG object>"
"<IPython.core.display.SVG at 0x7f7d034410f0>"
]
}
],
@ -569,7 +570,7 @@
"</svg>\n"
],
"text": [
"<spot.impl.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7f3c2515b810> >"
"<spot.impl.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7f7cef37ee10> >"
]
}
],
@ -639,7 +640,7 @@
"</svg>\n"
],
"text": [
"<spot.impl.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7f3c2515b690> >"
"<spot.impl.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7f7cef37ecc0> >"
]
}
],
@ -715,7 +716,7 @@
"</svg>\n"
],
"text": [
"<spot.impl.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7f3c2515b6f0> >"
"<spot.impl.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7f7cef37ed50> >"
]
}
],
@ -755,7 +756,7 @@
"cell_type": "code",
"collapsed": false,
"input": [
"f.translate('ba', 'small').show('v')"
"f.translate('ba', 'small').show('.v')"
],
"language": "python",
"metadata": {},
@ -765,15 +766,15 @@
"output_type": "pyout",
"prompt_number": 10,
"svg": [
"<svg height=\"177pt\" viewBox=\"0.00 0.00 251.00 177.00\" width=\"251pt\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n",
"<svg height=\"177pt\" viewBox=\"0.00 0.00 253.00 177.00\" width=\"253pt\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n",
"<g class=\"graph\" id=\"graph0\" transform=\"scale(1 1) rotate(0) translate(4 173)\">\n",
"<title>G</title>\n",
"<polygon fill=\"white\" points=\"-4,4 -4,-173 247,-173 247,4 -4,4\" stroke=\"none\"/>\n",
"<polygon fill=\"white\" points=\"-4,4 -4,-173 249,-173 249,4 -4,4\" stroke=\"none\"/>\n",
"<!-- I -->\n",
"<!-- 0 -->\n",
"<g class=\"node\" id=\"node2\"><title>0</title>\n",
"<ellipse cx=\"109\" cy=\"-113\" fill=\"#ffffaa\" rx=\"18\" ry=\"18\" stroke=\"black\"/>\n",
"<text font-family=\"Times,serif\" font-size=\"14.00\" text-anchor=\"middle\" x=\"109\" y=\"-109.3\">0</text>\n",
"<text font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"middle\" x=\"109\" y=\"-109.3\">0</text>\n",
"</g>\n",
"<!-- I&#45;&gt;0 -->\n",
"<g class=\"edge\" id=\"edge1\"><title>I-&gt;0</title>\n",
@ -784,61 +785,61 @@
"<g class=\"node\" id=\"node3\"><title>1</title>\n",
"<ellipse cx=\"22\" cy=\"-22\" fill=\"#ffffaa\" rx=\"18\" ry=\"18\" stroke=\"black\"/>\n",
"<ellipse cx=\"22\" cy=\"-22\" fill=\"none\" rx=\"22\" ry=\"22\" stroke=\"black\"/>\n",
"<text font-family=\"Times,serif\" font-size=\"14.00\" text-anchor=\"middle\" x=\"22\" y=\"-18.3\">1</text>\n",
"<text font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"middle\" x=\"22\" y=\"-18.3\">1</text>\n",
"</g>\n",
"<!-- 0&#45;&gt;1 -->\n",
"<g class=\"edge\" id=\"edge2\"><title>0-&gt;1</title>\n",
"<path d=\"M96.903,-99.6249C82.686,-85.081 58.8862,-60.7342 41.9306,-43.3887\" fill=\"none\" stroke=\"black\"/>\n",
"<polygon fill=\"black\" points=\"36.9064,-38.2491 44.0522,-41.0528 39.353,-40.7519 41.7996,-43.2548 41.7996,-43.2548 41.7996,-43.2548 39.353,-40.7519 39.547,-45.4567 36.9064,-38.2491 36.9064,-38.2491\" stroke=\"black\"/>\n",
"<text font-family=\"Times,serif\" font-size=\"14.00\" text-anchor=\"middle\" x=\"77.5\" y=\"-65.8\">a</text>\n",
"<text font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"74\" y=\"-65.8\">a</text>\n",
"</g>\n",
"<!-- 2 -->\n",
"<g class=\"node\" id=\"node4\"><title>2</title>\n",
"<ellipse cx=\"109\" cy=\"-22\" fill=\"#ffffaa\" rx=\"18\" ry=\"18\" stroke=\"black\"/>\n",
"<ellipse cx=\"109\" cy=\"-22\" fill=\"none\" rx=\"22\" ry=\"22\" stroke=\"black\"/>\n",
"<text font-family=\"Times,serif\" font-size=\"14.00\" text-anchor=\"middle\" x=\"109\" y=\"-18.3\">2</text>\n",
"<text font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"middle\" x=\"109\" y=\"-18.3\">2</text>\n",
"</g>\n",
"<!-- 0&#45;&gt;2 -->\n",
"<g class=\"edge\" id=\"edge3\"><title>0-&gt;2</title>\n",
"<path d=\"M109,-94.8399C109,-82.5378 109,-65.6842 109,-51.3928\" fill=\"none\" stroke=\"black\"/>\n",
"<polygon fill=\"black\" points=\"109,-44.1905 112.15,-51.1905 109,-47.6905 109,-51.1905 109,-51.1905 109,-51.1905 109,-47.6905 105.85,-51.1906 109,-44.1905 109,-44.1905\" stroke=\"black\"/>\n",
"<text font-family=\"Times,serif\" font-size=\"14.00\" text-anchor=\"middle\" x=\"112.5\" y=\"-65.8\">b</text>\n",
"<text font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"109\" y=\"-65.8\">b</text>\n",
"</g>\n",
"<!-- 3 -->\n",
"<g class=\"node\" id=\"node5\"><title>3</title>\n",
"<ellipse cx=\"196\" cy=\"-22\" fill=\"#ffffaa\" rx=\"18\" ry=\"18\" stroke=\"black\"/>\n",
"<ellipse cx=\"196\" cy=\"-22\" fill=\"none\" rx=\"22\" ry=\"22\" stroke=\"black\"/>\n",
"<text font-family=\"Times,serif\" font-size=\"14.00\" text-anchor=\"middle\" x=\"196\" y=\"-18.3\">3</text>\n",
"<ellipse cx=\"198\" cy=\"-22\" fill=\"#ffffaa\" rx=\"18\" ry=\"18\" stroke=\"black\"/>\n",
"<ellipse cx=\"198\" cy=\"-22\" fill=\"none\" rx=\"22\" ry=\"22\" stroke=\"black\"/>\n",
"<text font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"middle\" x=\"198\" y=\"-18.3\">3</text>\n",
"</g>\n",
"<!-- 0&#45;&gt;3 -->\n",
"<g class=\"edge\" id=\"edge4\"><title>0-&gt;3</title>\n",
"<path d=\"M121.097,-99.6249C135.314,-85.081 159.114,-60.7342 176.069,-43.3887\" fill=\"none\" stroke=\"black\"/>\n",
"<polygon fill=\"black\" points=\"181.094,-38.2491 178.453,-45.4567 178.647,-40.7519 176.2,-43.2548 176.2,-43.2548 176.2,-43.2548 178.647,-40.7519 173.948,-41.0528 181.094,-38.2491 181.094,-38.2491\" stroke=\"black\"/>\n",
"<text font-family=\"Times,serif\" font-size=\"14.00\" text-anchor=\"middle\" x=\"160.5\" y=\"-65.8\">c</text>\n",
"<path d=\"M121.375,-99.6249C135.919,-85.081 160.266,-60.7342 177.611,-43.3887\" fill=\"none\" stroke=\"black\"/>\n",
"<polygon fill=\"black\" points=\"182.751,-38.2491 180.029,-45.4262 180.276,-40.7239 177.801,-43.1988 177.801,-43.1988 177.801,-43.1988 180.276,-40.7239 175.574,-40.9714 182.751,-38.2491 182.751,-38.2491\" stroke=\"black\"/>\n",
"<text font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"158\" y=\"-65.8\">c</text>\n",
"</g>\n",
"<!-- 1&#45;&gt;1 -->\n",
"<g class=\"edge\" id=\"edge5\"><title>1-&gt;1</title>\n",
"<path d=\"M42.5808,-30.3702C52.8447,-31.5284 62,-28.7383 62,-22 62,-16.9463 56.8502,-14.1134 49.9451,-13.5015\" fill=\"none\" stroke=\"black\"/>\n",
"<polygon fill=\"black\" points=\"42.5808,-13.6298 49.5248,-10.3582 46.0803,-13.5688 49.5797,-13.5077 49.5797,-13.5077 49.5797,-13.5077 46.0803,-13.5688 49.6347,-16.6573 42.5808,-13.6298 42.5808,-13.6298\" stroke=\"black\"/>\n",
"<text font-family=\"Times,serif\" font-size=\"14.00\" text-anchor=\"middle\" x=\"65.5\" y=\"-18.3\">a</text>\n",
"<text font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"62\" y=\"-18.3\">a</text>\n",
"</g>\n",
"<!-- 2&#45;&gt;2 -->\n",
"<g class=\"edge\" id=\"edge6\"><title>2-&gt;2</title>\n",
"<path d=\"M129.581,-30.3702C139.845,-31.5284 149,-28.7383 149,-22 149,-16.9463 143.85,-14.1134 136.945,-13.5015\" fill=\"none\" stroke=\"black\"/>\n",
"<polygon fill=\"black\" points=\"129.581,-13.6298 136.525,-10.3582 133.08,-13.5688 136.58,-13.5077 136.58,-13.5077 136.58,-13.5077 133.08,-13.5688 136.635,-16.6573 129.581,-13.6298 129.581,-13.6298\" stroke=\"black\"/>\n",
"<text font-family=\"Times,serif\" font-size=\"14.00\" text-anchor=\"middle\" x=\"152.5\" y=\"-18.3\">b</text>\n",
"<text font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"149\" y=\"-18.3\">b</text>\n",
"</g>\n",
"<!-- 3&#45;&gt;3 -->\n",
"<g class=\"edge\" id=\"edge7\"><title>3-&gt;3</title>\n",
"<path d=\"M216.581,-30.3702C226.845,-31.5284 236,-28.7383 236,-22 236,-16.9463 230.85,-14.1134 223.945,-13.5015\" fill=\"none\" stroke=\"black\"/>\n",
"<polygon fill=\"black\" points=\"216.581,-13.6298 223.525,-10.3582 220.08,-13.5688 223.58,-13.5077 223.58,-13.5077 223.58,-13.5077 220.08,-13.5688 223.635,-16.6573 216.581,-13.6298 216.581,-13.6298\" stroke=\"black\"/>\n",
"<text font-family=\"Times,serif\" font-size=\"14.00\" text-anchor=\"middle\" x=\"239.5\" y=\"-18.3\">c</text>\n",
"<path d=\"M218.581,-30.3702C228.845,-31.5284 238,-28.7383 238,-22 238,-16.9463 232.85,-14.1134 225.945,-13.5015\" fill=\"none\" stroke=\"black\"/>\n",
"<polygon fill=\"black\" points=\"218.581,-13.6298 225.525,-10.3582 222.08,-13.5688 225.58,-13.5077 225.58,-13.5077 225.58,-13.5077 222.08,-13.5688 225.635,-16.6573 218.581,-13.6298 218.581,-13.6298\" stroke=\"black\"/>\n",
"<text font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"238\" y=\"-18.3\">c</text>\n",
"</g>\n",
"</g>\n",
"</svg>"
],
"text": [
"<IPython.core.display.SVG object>"
"<IPython.core.display.SVG at 0x7f7ced200cc0>"
]
}
],
@ -1028,7 +1029,7 @@
"</svg>"
],
"text": [
"<IPython.core.display.SVG object>"
"<IPython.core.display.SVG at 0x7f7ced19d7f0>"
]
}
],
@ -1175,7 +1176,7 @@
"</svg>\n"
],
"text": [
"<spot.impl.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7f3c2515be10> >"
"<spot.impl.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7f7cef37ef60> >"
]
}
],
@ -1276,7 +1277,7 @@
"</svg>\n"
],
"text": [
"<spot.impl.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7f3c2515bed0> >"
"<spot.impl.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7f7cef37ef30> >"
]
}
],
@ -1394,7 +1395,7 @@
"</svg>\n"
],
"text": [
"<spot.impl.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7f3c2515b630> >"
"<spot.impl.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7f7cef37ef00> >"
]
}
],
@ -1493,7 +1494,7 @@
"</svg>\n"
],
"text": [
"<spot.impl.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7f3c2515b6c0> >"
"<spot.impl.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7f7cef37ed20> >"
]
}
],
@ -1963,7 +1964,7 @@
"</svg>\n"
],
"text": [
"<spot.impl.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7f3c2515b450> >"
"<spot.impl.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7f7cef37ef90> >"
]
}
],
@ -2160,7 +2161,7 @@
"</svg>"
],
"text": [
"<IPython.core.display.SVG object>"
"<IPython.core.display.SVG at 0x7f7ced19d5c0>"
]
},
{
@ -2285,7 +2286,7 @@
"</svg>"
],
"text": [
"<IPython.core.display.SVG object>"
"<IPython.core.display.SVG at 0x7f7d03411e10>"
]
},
{
@ -2427,7 +2428,7 @@
"</svg>"
],
"text": [
"<IPython.core.display.SVG object>"
"<IPython.core.display.SVG at 0x7f7ced1fa710>"
]
},
{
@ -2578,7 +2579,7 @@
"</svg>\n"
],
"text": [
"<spot.impl.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7f3c2515b840> >"
"<spot.impl.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7f7cef37ecf0> >"
]
}
],
@ -2734,7 +2735,7 @@
"</svg>\n"
],
"text": [
"<spot.impl.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7f3c250f61e0> >"
"<spot.impl.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7f7cef37eed0> >"
]
}
],
@ -2804,7 +2805,7 @@
"</svg>\n"
],
"text": [
"<spot.impl.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7f3c250f6150> >"
"<spot.impl.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7f7cef37ecf0> >"
]
}
],
@ -2876,7 +2877,7 @@
"</svg>"
],
"text": [
"<IPython.core.display.SVG object>"
"<IPython.core.display.SVG at 0x7f7ced1863c8>"
]
},
{
@ -2929,7 +2930,7 @@
"</svg>"
],
"text": [
"<IPython.core.display.SVG object>"
"<IPython.core.display.SVG at 0x7f7ced1913c8>"
]
},
{
@ -3041,7 +3042,7 @@
"</svg>"
],
"text": [
"<IPython.core.display.SVG object>"
"<IPython.core.display.SVG at 0x7f7ced18d160>"
]
},
{
@ -3153,7 +3154,7 @@
"</svg>"
],
"text": [
"<IPython.core.display.SVG object>"
"<IPython.core.display.SVG at 0x7f7ced1b7668>"
]
}
],
@ -3166,7 +3167,7 @@
"language": "python",
"metadata": {},
"outputs": [],
"prompt_number": null
"prompt_number": 23
}
],
"metadata": {}