MOD code style
"""
Normalized Parallel Coordinates Example
-----------------------------
+---------------------------------------
A `Parallel Coordinates <https://en.wikipedia.org/wiki/Parallel_coordinates>`_
chart is a chart that lets you visualize the individual data points by drawing
a single line for each of them.
@@ -19,18 +19,23 @@ from altair import datum
source = data.iris()
-(alt.Chart(source)
- .transform_window(
- index='count()')
- .transform_fold(
- ['petalLength', 'petalWidth', 'sepalLength', 'sepalWidth'])
- .transform_joinaggregate(
- min='min(value)', max='max(value)',
- groupby=['key'])
- .transform_calculate(minmax_value=(datum.value-datum.min)/(datum.max-datum.min), mid=(datum.min+datum.max)/2)
- .mark_line()
- .encode(
- x='key:N',y='minmax_value:Q',color='species:N',detail='index:N',opacity=alt.value(0.5))
- .properties(width=500)
-)
+alt.Chart(source).transform_window(
+ index='count()'
+).transform_fold(
+ ['petalLength', 'petalWidth', 'sepalLength', 'sepalWidth']
+).transform_joinaggregate(
+ min='min(value)',
+ max='max(value)',
+ groupby=['key']
+).transform_calculate(
+ minmax_value=(datum.value-datum.min)/(datum.max-datum.min),
+ mid=(datum.min+datum.max)/2
+).mark_line().encode(
+ x='key:N',
+ y='minmax_value:Q',
+ color='species:N',
+ detail='index:N',
+ opacity=alt.value(0.5)
+).properties(width=500)
+
