This is an automated email from the ASF dual-hosted git repository.

shenyi pushed a commit to branch enhance-morph
in repository https://gitbox.apache.org/repos/asf/echarts.git


The following commit(s) were added to refs/heads/enhance-morph by this push:
     new 0710cd2  test(ut): add test case for transition treemap, sunburst
0710cd2 is described below

commit 0710cd25e85a0ae8b677e435563db40a994dae0a
Author: pissang <[email protected]>
AuthorDate: Thu Jun 10 23:42:56 2021 +0800

    test(ut): add test case for transition treemap, sunburst
---
 test/universalTransition.html | 216 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 216 insertions(+)

diff --git a/test/universalTransition.html b/test/universalTransition.html
index 00386e6..8a4c644 100644
--- a/test/universalTransition.html
+++ b/test/universalTransition.html
@@ -38,6 +38,7 @@ under the License.
 
 
         <div id="main0"></div>
+        <div id="main1"></div>
 
 
 
@@ -158,6 +159,221 @@ under the License.
         </script>
 
 
+
+        <script>
+            require([
+                'echarts'
+            ], function (echarts) {
+                var item1 = {
+                    color: '#F54F4A'
+                };
+                var item2 = {
+                    color: '#FF8C75'
+                };
+                var item3 = {
+                    color: '#FFB499'
+                };
+
+                var data = [{
+                    children: [{
+                        value: 5,
+                        children: [{
+                            value: 1,
+                            itemStyle: item1
+                        }, {
+                            value: 2,
+                            children: [{
+                                value: 1,
+                                itemStyle: item2
+                            }]
+                        }, {
+                            children: [{
+                                value: 1
+                            }]
+                        }],
+                        itemStyle: item1
+                    }, {
+                        value: 10,
+                        children: [{
+                            value: 6,
+                            children: [{
+                                value: 1,
+                                itemStyle: item1
+                            }, {
+                                value: 1
+                            }, {
+                                value: 1,
+                                itemStyle: item2
+                            }, {
+                                value: 1
+                            }],
+                            itemStyle: item3
+                        }, {
+                            value: 2,
+                            children: [{
+                                value: 1
+                            }],
+                            itemStyle: item3
+                        }, {
+                            children: [{
+                                value: 1,
+                                itemStyle: item2
+                            }]
+                        }],
+                        itemStyle: item1
+                    }],
+                    itemStyle: item1
+                }, {
+                    value: 9,
+                    children: [{
+                        value: 4,
+                        children: [{
+                            value: 2,
+                            itemStyle: item2
+                        }, {
+                            children: [{
+                                value: 1,
+                                itemStyle: item1
+                            }]
+                        }],
+                        itemStyle: item1
+                    }, {
+                        children: [{
+                            value: 3,
+                            children: [{
+                                value: 1
+                            }, {
+                                value: 1,
+                                itemStyle: item2
+                            }]
+                        }],
+                        itemStyle: item3
+                    }],
+                    itemStyle: item2
+                }, {
+                    value: 7,
+                    children: [{
+                        children: [{
+                            value: 1,
+                            itemStyle: item3
+                        }, {
+                            value: 3,
+                            children: [{
+                                value: 1,
+                                itemStyle: item2
+                            }, {
+                                value: 1
+                            }],
+                            itemStyle: item2
+                        }, {
+                            value: 2,
+                            children: [{
+                                value: 1
+                            }, {
+                                value: 1,
+                                itemStyle: item1
+                            }],
+                            itemStyle: item1
+                        }],
+                        itemStyle: item3
+                    }],
+                    itemStyle: item1
+                }, {
+                    children: [{
+                        value: 6,
+                        children: [{
+                            value: 1,
+                            itemStyle: item2
+                        }, {
+                            value: 2,
+                            children: [{
+                                value: 2,
+                                itemStyle: item2
+                            }],
+                            itemStyle: item1
+                        }, {
+                            value: 1,
+                            itemStyle: item3
+                        }],
+                        itemStyle: item3
+                    }, {
+                        value: 3,
+                        children: [{
+                            value: 1,
+                        }, {
+                            children: [{
+                                value: 1,
+                                itemStyle: item2
+                            }]
+                        }, {
+                            value: 1
+                        }],
+                        itemStyle: item3
+                    }],
+                    itemStyle: item1
+                }];
+
+                function makeTreemapOption() {
+                    return {
+                        series: {
+                            type: 'treemap',
+                            id: 'main',
+                            data,
+                            animationDurationUpdate: 1000,
+                            breadcrumb: {
+                                show: false
+                            },
+                            universalAnimation: {
+                                enabled: true
+                            },
+                            itemStyle: {
+                                color: '#ddd',
+                                borderWidth: 2
+                            }
+                        }
+                    };
+                }
+
+                function makeSunburstOption() {
+                    return {
+                        series: {
+                            radius: ['15%', '80%'],
+                            type: 'sunburst',
+                            id: 'main',
+                            data,
+                            animationDurationUpdate: 1000,
+                            universalAnimation: {
+                                enabled: true
+                            },
+                            itemStyle: {
+                                color: '#ddd',
+                                borderWidth: 2
+                            }
+                        }
+                    };
+                }
+
+                var chart = testHelper.create(echarts, 'main0', {
+                    title: [
+                        'Convert between treemap, sunburst'
+                    ],
+                    // height: 300,
+                    buttons: [{
+                        text: 'Treemap',
+                        onclick: function () {
+                            chart.setOption(makeTreemapOption());
+                        }
+                    }, {
+                        text: 'Sunburst',
+                        onclick: function () {
+                            chart.setOption(makeSunburstOption());
+                        }
+                    }],
+                    option: makeTreemapOption()
+                });
+            });
+            </script>
+
     </body>
 </html>
 

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to