Skip to content

Datagrid gets transposed (axis are swapped) when plugin is changed from "Grid" to "Heatmap" #1127

@pgagarinov

Description

@pgagarinov

Bug Report

Steps to Reproduce:

1.

import pandas as pd
import numpy as np
from perspective import PerspectiveWidget
from datetime import timedelta,date
arrays = {'A':['bar', 'bar', 'bar', 'bar', 'baz', 'baz', 'baz', 'baz', 'foo', 'foo', 'foo', 'foo', 'qux', 'qux', 'qux', 'qux'],
          'B':['one', 'one', 'two', 'two', 'one', 'one', 'two', 'two', 'one', 'one', 'two', 'two', 'one', 'one', 'two', 'two'],
          'C':['X', 'Y', 'X', 'Y', 'X', 'Y', 'X', 'Y', 'X', 'Y', 'X', 'Y', 'X', 'Y', 'X', 'Y'],
          'D':np.arange(date(2020,6,1),date(2020,6,17),timedelta(days=1),dtype=date)}

df = pd.DataFrame(arrays)
df.set_index(['D'])

image

2.

psp = PerspectiveWidget(df, row_pivots=['D'], column_pivots=['A','B'],aggregates={'C':'count'},columns=['C'])
psp

image

So far so good...

3.

Let us change "Grid" to "Heatmap" on UI (by hand):

image

We see that the axis are swapped while the column names in "groupBy" and "splitBy" remained the same.
This is incorrect.

Expected Result:

image

Environment:

Perspective 0.5.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    PythonbugConcrete, reproducible bugs

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions