oguzhaninan / vue-histogram-slider

Range slider with histogram for Vue.js
https://npmjs.com/package/vue-histogram-slider
MIT License
123 stars 49 forks source link

Histogram doesn't react to data changes #7

Closed diegonc closed 4 years ago

diegonc commented 4 years ago

I set the data property to a computed property of the containing component and the slider doesn't update the bars.

If I change the section and then go back to where the slider is used then it updates. It seems that it only gets rendered on mount.

oguzhaninan commented 4 years ago

Thanks @diegonc. I wil fix it.

KubeljK commented 4 years ago

@oguzhaninan Has any progress been made on this issue?

oguzhaninan commented 4 years ago

Yes @KubeljK I fixed this issue.

markusand commented 3 years ago

What version was this fixed at? It doesn't seem to work in the CodeSandbox example using 0.3.8.

<template>
  <div id="app">
    <input
      type="range"
      min="0"
      max="1000"
      v-model.number="dataSize">
    <HistogramSlider
      :width="300"
      :data="data"
      :min="0"
      :max="Math.max(...data)"
    />
    {{ data }}
  </div>
</template>

<script>
export default {
  name: "App",
  data() {
    return { dataSize: 100 };
  },
  computed: {
    data() {
      const { dataSize } = this;
      return [...Array(dataSize).keys()]
        .map(() => Math.round(Math.random() * 100));
    }
  },
};
</script>
hsks commented 3 years ago

Facing the same issue. Realtime data updates don't seem to be reflected.

eugv86 commented 3 years ago

Still an issue... @hsks @markusand were you guys able to figure this out?

dragma commented 2 years ago

Still an issue. Anyone hasn't found any workaround still ?