浏览代码

fixed chart callback indicators propagation

Natan 1 年之前
父节点
当前提交
e062bbbb99
共有 2 个文件被更改,包括 6 次插入6 次删除
  1. 2 2
      .vscode/settings.json
  2. 4 4
      nicegui/elements/chart.js

+ 2 - 2
.vscode/settings.json

@@ -3,13 +3,13 @@
   "editor.formatOnSave": true,
   "isort.args": ["--line-length", "120"],
   "prettier.printWidth": 120,
-  "python.formatting.provider": "autopep8",
+  "python.formatting.provider": "none",
   "python.formatting.autopep8Args": ["--max-line-length=120", "--experimental"],
   "python.testing.pytestArgs": ["."],
   "python.testing.pytestEnabled": true,
   "python.testing.unittestEnabled": false,
   "[python]": {
-    "editor.defaultFormatter": "ms-python.python",
+    "editor.defaultFormatter": "ms-python.autopep8",
     "editor.codeActionsOnSave": {
       "source.organizeImports": true
     }

+ 4 - 4
nicegui/elements/chart.js

@@ -17,8 +17,7 @@ export default {
         if (!this.options.plotOptions.series.point.events) {
           this.options.plotOptions.series.point.events = {};
         }
-        // if (this.on_event_set === true) {
-        if (true) {
+        if (this.on_event_set === true) {
           this.options.plotOptions.series.point.events.click = (e) => {
             this.$emit("on_event", {
               event_type: "point_click",
@@ -29,8 +28,7 @@ export default {
             });
           };
         }
-        // if (this.on_drag_drop_set === true) {
-        if (true) {
+        if (this.on_drag_drop_set === true) {
           this.options.plotOptions.series.point.events.dragStart = (e) => {
             this.$emit("on_point_drag_drop", {
               event_type: "point_drag_start",
@@ -93,5 +91,7 @@ export default {
     type: String,
     options: Object,
     extras: Array,
+    on_event_set: Boolean,
+    on_drag_drop_set: Boolean,
   },
 };