Skip to content

Commit d3ac5c1

Browse files
Merge pull request #25 from David-Desmaisons/send-resize-event
Adding resize event
2 parents 91fbf68 + f5be5e7 commit d3ac5c1

File tree

6 files changed

+908
-842
lines changed

6 files changed

+908
-842
lines changed

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,14 @@ Failing to do so may result in a component whose size that will keep increasing.
231231

232232
- `value` **Object** - {node, sunburst} The corresponding node and sunburst component
233233

234+
- `resize`
235+
236+
Fired when component is resizing.
237+
238+
**arguments:**
239+
240+
- `value` **Object** - {radius, height, width} Size information in pixel
241+
234242
#### methods
235243

236244
- `highlightPath(node, opacity)`

example/App.vue

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,10 @@
7777
</div>
7878
</div>
7979
<div class="col-9">
80-
<div class="card control-left">
80+
<div class="card control-middle">
8181
<div class="card-header">Sunburst</div>
8282
<div class="card-body father">
83-
<sunburst class="sunburst" :data="data" :centralCircleRelativeSize="centralCircleRelativeSize" :showLabels="showLabels" :minAngleDisplayed="minAngleDisplayed" :colorScheme="colorScheme" :colorScale="colorScale" :inAnimationDuration="inAnimationDuration" :outAnimationDuration="outAnimationDuration">
83+
<sunburst id="resizable" class="sunburst" :data="data" :centralCircleRelativeSize="centralCircleRelativeSize" :showLabels="showLabels" :minAngleDisplayed="minAngleDisplayed" :colorScheme="colorScheme" :colorScale="colorScale" :inAnimationDuration="inAnimationDuration" :outAnimationDuration="outAnimationDuration">
8484

8585
<breadcrumbTrail slot="legend" slot-scope="{ nodes, colorGetter, width }" :current="nodes.mouseOver" :root="nodes.root" :colorGetter="colorGetter" :from="nodes.zoomed" :width="width" />
8686

@@ -99,6 +99,9 @@
9999
</template>
100100

101101
<script>
102+
import $ from "jquery";
103+
import "jquery-ui/ui/widgets/resizable.js";
104+
102105
import sunburst from "@/components/sunburst";
103106
import nodeInfoDisplayer from "@/components/nodeInfoDisplayer";
104107
import breadcrumbTrail from "@/components/breadcrumbTrail";
@@ -145,6 +148,11 @@ export default {
145148
return data.name;
146149
}
147150
},
151+
mounted(){
152+
$("#resizable").resizable({
153+
containment: "parent"
154+
});
155+
},
148156
components: {
149157
sunburst,
150158
nodeInfoDisplayer,
@@ -170,7 +178,7 @@ export default {
170178
height: 800px;
171179
}
172180
173-
.control-left {
181+
.control-middle {
174182
height: 600px;
175183
}
176184

example/main.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import Vue from "vue";
22
import App from "./App.vue";
33
import "bootstrap/dist/css/bootstrap.css";
44
import "font-awesome/less/font-awesome.less";
5+
import "jquery-ui/themes/base/all.css";
56

67
Vue.config.productionTip = false;
78

0 commit comments

Comments
 (0)