D3-graph-gallery icon indicating copy to clipboard operation
D3-graph-gallery copied to clipboard

Use d3 with rails 6

Open NehaPeer opened this issue 3 years ago • 0 comments

Using ruby 2.7.3 Rails 6.1.3

I am using d3 but it throws the below error on console -

TypeError: setting getter-only property "format" using Ie https://d3js.org/d3.v4.min.js:2 https://d3js.org/d3.v4.min.js:2 https://d3js.org/d3.v4.min.js:2 https://d3js.org/d3.v4.min.js:2

On the view page, I have added the below code -

<script src="https://d3js.org/d3.v4.min.js">
</script>
<%= javascript_pack_tag "home/index" %>*

Below line added app/javascript/packs/application.js -

import * as d3 from "d3" window.d3 = d3

Please give suggestions on these.

NehaPeer avatar Nov 19 '21 12:11 NehaPeer