mirror of
https://github.com/kemko/nomad.git
synced 2026-01-06 18:35:44 +03:00
Remove jquery from the distribution bar chart
This commit is contained in:
@@ -43,11 +43,12 @@ export default Component.extend(WindowResizable, {
|
||||
}),
|
||||
|
||||
didInsertElement() {
|
||||
const chart = d3.select(this.$('svg')[0]);
|
||||
const svg = this.element.querySelector('svg');
|
||||
const chart = d3.select(svg);
|
||||
const maskId = `dist-mask-${guidFor(this)}`;
|
||||
this.setProperties({ chart, maskId });
|
||||
|
||||
this.$('svg clipPath').attr('id', maskId);
|
||||
svg.querySelector('clipPath').setAttribute('id', maskId);
|
||||
|
||||
chart.on('mouseleave', () => {
|
||||
run(() => {
|
||||
@@ -75,7 +76,7 @@ export default Component.extend(WindowResizable, {
|
||||
/* eslint-disable */
|
||||
renderChart() {
|
||||
const { chart, _data, isNarrow } = this;
|
||||
const width = this.$('svg').width();
|
||||
const width = this.element.querySelector('svg').clientWidth;
|
||||
const filteredData = _data.filter(d => d.value > 0);
|
||||
filteredData.forEach((d, index) => {
|
||||
set(d, 'index', index);
|
||||
|
||||
Reference in New Issue
Block a user