You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by sh...@apache.org on 2019/12/31 06:40:06 UTC

[incubator-echarts] branch group-draggable created (now 44bfbd7)

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

shenyi pushed a change to branch group-draggable
in repository https://gitbox.apache.org/repos/asf/incubator-echarts.git.


      at 44bfbd7  feat(graphic): add draggable support on group elements.

This branch includes the following new commits:

     new 44bfbd7  feat(graphic): add draggable support on group elements.

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org


[incubator-echarts] 01/01: feat(graphic): add draggable support on group elements.

Posted by sh...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 44bfbd7f4d249bbb45af4b463a466af87aa53af3
Author: pissang <bm...@gmail.com>
AuthorDate: Tue Dec 31 14:39:49 2019 +0800

    feat(graphic): add draggable support on group elements.
---
 test/graphic-draggable.html                 | 140 ++++++++++++++++++++++++++++
 test/runTest/actions/__meta__.json          |   1 +
 test/runTest/actions/graphic-draggable.json |   1 +
 3 files changed, 142 insertions(+)

diff --git a/test/graphic-draggable.html b/test/graphic-draggable.html
new file mode 100644
index 0000000..c2058ee
--- /dev/null
+++ b/test/graphic-draggable.html
@@ -0,0 +1,140 @@
+<!DOCTYPE html>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+   http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+
+<html>
+    <head>
+        <meta charset="utf-8">
+        <meta name="viewport" content="width=device-width, initial-scale=1" />
+        <script src="lib/esl.js"></script>
+        <script src="lib/config.js"></script>
+        <script src="lib/jquery.min.js"></script>
+        <script src="lib/facePrint.js"></script>
+        <script src="lib/testHelper.js"></script>
+        <link rel="stylesheet" href="lib/reset.css" />
+    </head>
+    <body>
+        <div id="main0"></div>
+
+
+        <script>
+        require(['echarts'], function (echarts) {
+            var option;
+
+            option = {
+                graphic: [{
+                    elements: [{
+                        type: 'rect',
+                        shape: {
+                            x: -50, y: -50, width: 100, height: 100
+                        },
+                        style: {
+                            fill: 'blue'
+                        },
+                        position: [200, 200],
+                        rotation: 1,
+                        cursor: 'move',
+                        draggable: true
+                    }, {
+                        type: 'circle',
+                        shape: {
+                            cx: 100, cy: 100, r: 50
+                        },
+                        style: {
+                            fill: 'red'
+                        },
+                        rotation: 0.3,
+                        cursor: 'move',
+                        draggable: true
+                    }, {
+                        type: 'text',
+                        style: {
+                            text: 'DRAG ME',
+                            font: '20px sans-serif'
+                        },
+                        position: [300, 50],
+                        cursor: 'move',
+                        draggable: true
+                    }, {
+                        type: 'bezierCurve',
+                        shape: {
+                            x1: 10,
+                            y1: 10,
+                            x2: 100,
+                            y2: 10,
+                            cpx1: 60,
+                            cpy1: 100
+                        },
+                        style: {
+                            fill: 'green',
+                            lineWidth: 10
+                        },
+                        left: 300,
+                        bottom: 100,
+                        cursor: 'move',
+                        draggable: true
+                    }, {
+                        type: 'group',
+                        draggable: true,
+                        children: [{
+                            type: 'rect',
+                            shape: {
+                                x: -30, y: -30, width: 60, height: 60
+                            },
+                            style: {
+                                fill: '#aaa'
+                            },
+                            rotation: 2,
+                            cursor: 'move'
+                        }, {
+                            type: 'circle',
+                            shape: {
+                                cx: 40, cy: 0, r: 40
+                            },
+                            style: {
+                                fill: '#777'
+                            },
+                            cursor: 'move'
+                        }, {
+                            type: 'text',
+                            style: {
+                                x: 100,
+                                text: 'DRAG GROUP',
+                                textAlign: 'left',
+                                font: '16px sans-serif'
+                            },
+                            cursor: 'move'
+                        }],
+                        position: [500, 200]
+                    }]
+                },]
+            };
+
+            var chart = testHelper.create(echarts, 'main0', {
+                title: [
+                    'Draggable on different elements'
+                ],
+                option: option
+            });
+        });
+        </script>
+    </body>
+</html>
+
diff --git a/test/runTest/actions/__meta__.json b/test/runTest/actions/__meta__.json
index 8fcd269..6d70724 100644
--- a/test/runTest/actions/__meta__.json
+++ b/test/runTest/actions/__meta__.json
@@ -79,6 +79,7 @@
   "graph": 2,
   "graph-grid": 1,
   "graph-simple": 2,
+  "graphic-draggable": 1,
   "heatmap": 1,
   "heatmap-map": 1,
   "homepage3": 1,
diff --git a/test/runTest/actions/graphic-draggable.json b/test/runTest/actions/graphic-draggable.json
new file mode 100644
index 0000000..fd453b1
--- /dev/null
+++ b/test/runTest/actions/graphic-draggable.json
@@ -0,0 +1 @@
+[{"name":"Action 1","ops":[{"type":"mousedown","time":594,"x":140,"y":107},{"type":"mousemove","time":670,"x":140,"y":109},{"type":"mousemove","time":877,"x":123,"y":295},{"type":"mousemove","time":1094,"x":118,"y":389},{"type":"mouseup","time":1148,"x":118,"y":389},{"time":1149,"delay":400,"type":"screenshot-auto"},{"type":"mousemove","time":1303,"x":144,"y":348},{"type":"mousemove","time":1503,"x":210,"y":274},{"type":"mousedown","time":1645,"x":210,"y":272},{"type":"mousemove","time": [...]
\ No newline at end of file


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org