From daca5c121e45ad3054ee1b868f8c607297a5dc3f Mon Sep 17 00:00:00 2001 From: ericbdaniels Date: Fri, 26 Mar 2021 10:49:06 -0600 Subject: [PATCH] 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 --- dash_vtk/utils/vtk.py | 2 +- docs/CHANGELOG.md | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/dash_vtk/utils/vtk.py b/dash_vtk/utils/vtk.py index 3106b38..1bfcb09 100644 --- a/dash_vtk/utils/vtk.py +++ b/dash_vtk/utils/vtk.py @@ -66,7 +66,7 @@ def to_mesh_state(dataset, field_to_keep=None): if c_array: dataRange = c_array.GetRange(-1) nb_comp = c_array.GetNumberOfComponents() - values = vtk_to_numpy(p_array).ravel() + values = vtk_to_numpy(c_array).ravel() js_types = to_js_type[str(values.dtype)] location = 'CellData' diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 12474e8..752b114 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -5,6 +5,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] +### Fixed +* fix bug when using cell data with `to_mesh_state` ## [0.0.6] - 2021-02-22