Simplify default xy formatter

incremental_update_paths
Tyler Goodlet 2022-05-19 10:35:22 -04:00
parent 17456d96e0
commit fa30df36ba
1 changed files with 7 additions and 10 deletions

View File

@ -925,15 +925,7 @@ def by_index_and_key(
np.ndarray, np.ndarray,
np.ndarray, np.ndarray,
]: ]:
# full input data return array['index'], array[array_key], 'all'
x = array['index']
y = array[array_key]
return tuple({
'x': x,
'y': y,
'connect': 'all',
}.values())
class Renderer(msgspec.Struct): class Renderer(msgspec.Struct):
@ -941,7 +933,12 @@ class Renderer(msgspec.Struct):
flow: Flow flow: Flow
# last array view read # last array view read
last_read: Optional[tuple] = None last_read: Optional[tuple] = None
format_xy: Callable[np.ndarray, tuple[np.ndarray]] = by_index_and_key
# default just returns index, and named array from data
format_xy: Callable[
[np.ndarray, str],
tuple[np.ndarray]
] = by_index_and_key
# output graphics rendering, the main object # output graphics rendering, the main object
# processed in ``QGraphicsObject.paint()`` # processed in ``QGraphicsObject.paint()``