Giter Site home page Giter Site logo

easyplotly's Issues

Sunburst plots only work when the data has type 'int'

To reproduce:

sample = pd.Series({('A29', 'B13', 'C12'): 5.493773959272917,
 ('A29', 'B13', 'C26'): 2.2714461834768,
 ('A29', 'B21', 'C0'): 88.58984469930006,
 ('A29', 'B21', 'C10'): 49.917348529753944,
 ('A29', 'B21', 'C11'): 36.98928975179809,
 ('A29', 'B21', 'C15'): 121.99673244630752,
 ('A29', 'B21', 'C16'): 206.97254210656655,
 ('A29', 'B21', 'C17'): 63.85640681578763,
 ('A29', 'B21', 'C19'): 57.01853927100491,
 ('A29', 'B21', 'C20'): 6.763690315612155,
 ('A29', 'B21', 'C22'): 265.08813270574456,
 ('A29', 'B21', 'C23'): 9.5107439614563,
 ('A29', 'B21', 'C25'): 9.317356993442678,
 ('A29', 'B21', 'C27'): 200.59786382112475,
 ('A29', 'B21', 'C28'): 23.34446288198481,
 ('A29', 'B21', 'C5'): 23.26127917763646,
 ('A29', 'B21', 'C6'): 579.8444286101725,
 ('A29', 'B21', 'C7'): 87.78781070421874,
 ('A29', 'B21', 'C8'): 301.84979651884726,
 ('A29', 'B21', 'C9'): 56.83442956265254,
 ('A29', 'B3', 'C1'): 1.5845332508786036,
 ('A29', 'B3', 'C31'): 5.8081384631896515,
 ('A4', 'B14', 'C18'): 5.6594222679697905,
 ('A4', 'B14', 'C30'): 87.03101418066653,
 ('A4', 'B24', 'C2'): 14.643236457824742}, 
                   index=[('A4', 'B24', 'C2'),
 ('A4', 'B14', 'C18'),
 ('A4', 'B14', 'C30'),
 ('A29', 'B21', 'C11'),
 ('A29', 'B21', 'C6'),
 ('A29', 'B21', 'C0'),
 ('A29', 'B21', 'C16'),
 ('A29', 'B21', 'C5'),
 ('A29', 'B21', 'C20'),
 ('A29', 'B21', 'C9'),
 ('A29', 'B21', 'C8'),
 ('A29', 'B21', 'C7'),
 ('A29', 'B21', 'C19'),
 ('A29', 'B21', 'C15'),
 ('A29', 'B21', 'C17'),
 ('A29', 'B21', 'C10'),
 ('A29', 'B21', 'C28'),
 ('A29', 'B21', 'C25'),
 ('A29', 'B21', 'C23'),
 ('A29', 'B21', 'C22'),
 ('A29', 'B21', 'C27'),
 ('A29', 'B13', 'C12'),
 ('A29', 'B13', 'C26'),
 ('A29', 'B3', 'C1'),
 ('A29', 'B3', 'C31')])

Then

go.Figure(ep.Treemap(sample))

displays nothing, while

go.Figure(ep.Treemap(sample.astype(int))

works.

The treemap object that corresponds to the first case is

Treemap({
    'branchvalues': 'total',
    'ids': [/A4/B24/C2, /A4/B14/C18, /A4/B14/C30, /A29/B21/C11, /A29/B21/C6,
            /A29/B21/C0, /A29/B21/C16, /A29/B21/C5, /A29/B21/C20, /A29/B21/C9,
            /A29/B21/C8, /A29/B21/C7, /A29/B21/C19, /A29/B21/C15, /A29/B21/C17,
            /A29/B21/C10, /A29/B21/C28, /A29/B21/C25, /A29/B21/C23, /A29/B21/C22,
            /A29/B21/C27, /A29/B13/C12, /A29/B13/C26, /A29/B3/C1, /A29/B3/C31,
            /A4/B24, /A4, /A4/B14, /A29/B21, /A29, /A29/B13, /A29/B3],
    'labels': [C2, C18, C30, C11, C6, C0, C16, C5, C20, C9, C8, C7, C19, C15, C17,
               C10, C28, C25, C23, C22, C27, C12, C26, C1, C31, B24, A4, B14, B21,
               A29, B13, B3],
    'parents': [/A4/B24, /A4/B14, /A4/B14, /A29/B21, /A29/B21, /A29/B21, /A29/B21,
                /A29/B21, /A29/B21, /A29/B21, /A29/B21, /A29/B21, /A29/B21,
                /A29/B21, /A29/B21, /A29/B21, /A29/B21, /A29/B21, /A29/B21,
                /A29/B21, /A29/B21, /A29/B13, /A29/B13, /A29/B3, /A29/B3, /A4,
                None, /A4, /A29, None, /A29, /A29],
    'values': [14.643236457824742, 5.6594222679697905, 87.03101418066653,
               36.98928975179809, 579.8444286101725, 88.58984469930006,
               206.97254210656655, 23.26127917763646, 6.763690315612155,
               56.83442956265254, 301.84979651884726, 87.78781070421874,
               57.01853927100491, 121.99673244630752, 63.85640681578763,
               49.917348529753944, 23.34446288198481, 9.317356993442678,
               9.5107439614563, 265.08813270574456, 200.59786382112475,
               5.493773959272917, 2.2714461834768, 1.5845332508786036,
               5.8081384631896515, 14.643236457824742, 107.33367290646106,
               92.69043644863632, 2189.5406988734117, 2204.698590730229,
               7.765220142749717, 7.392671714068255]
})

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.