Skip to content

Commit daca5c1

Browse files
authored
fix bug when using cell data with to_mesh_state (#36)
* Update vtk.py fixing typo where point data is used for cell data in `to_mesh_state` * Update CHANGELOG.md update changelog
1 parent 6be5b01 commit daca5c1

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

dash_vtk/utils/vtk.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ def to_mesh_state(dataset, field_to_keep=None):
6666
if c_array:
6767
dataRange = c_array.GetRange(-1)
6868
nb_comp = c_array.GetNumberOfComponents()
69-
values = vtk_to_numpy(p_array).ravel()
69+
values = vtk_to_numpy(c_array).ravel()
7070
js_types = to_js_type[str(values.dtype)]
7171
location = 'CellData'
7272

docs/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

77
## [Unreleased]
8+
### Fixed
9+
* fix bug when using cell data with `to_mesh_state`
810

911
## [0.0.6] - 2021-02-22
1012

0 commit comments

Comments
 (0)