Hot answers tagged

3

I tried out the first scenarios me.teapot.svgContainer.selectAll("g").remove(); defining me.teapot.svgContainer to be what you stated in the comment. This executes successfully in Summer '17 without any error. For the 2nd scenario, I couldn't get me.teapot.svgContainer.node() to return anything meaninful, even with LockerService disabled. It must be defined ...


3

This has been resolved in the Summer '17 major release. LockerService was mistakenly excluding a number of SVG elements and their properties from being exposed. Among these were SVGTransformList and SVGAnimatedTransformList. Also, please continue to use D3 version 4.4.0 as it is currently the most reliable to work inside Locker.


2

The simple, but incomplete, answer is that you'd use visualforce expression syntax just like you would use anywhere else. {!expression} is evaluated on the server, before the page itself is rendered. If your controller had the following property in it public String myData {set;} and, in your controller, you explicitly define a getter method public String ...


2

There have been several fixes to released since this question was originally posted. I just tried running a simple app using D3 version 4.3.0 and everything loads/runs fine with LockerService enabled. Just wanted to confirm all your issues are resolved.


2

When running JavaScript you should always have your browser's developer tools displayed, particularly the JavaScript console. If you do (at least in Chrome and probably other browsers too), you will find that all the http:// requests are blocked: [blocked] The page at '...' was loaded over HTTPS, but ran insecure content from '...': this content should ...


1

This answer doesn't have much to do with Lightning App Builder -- it has more to do with D3 internals and understanding how to manage the value of the SVG's height attribute in LWC. For a working LWC + D3 starting point, I played around with the D3 example in lwc-recipes to see if I could get the component to adjust its height automatically. I was able to ...


1

Dispatch a new customEvent with the detail of the selected product's name. Then have the div which contains your d3 svg handle that event this.dispatchEvent(new CustomEvent('productclicked', { detail: d.data.name, bubbles: true })); <div onproductclicked={handleProductClicked}> <svg class="d3" width={svgWidth} height={...


1

You're probably missing this library, it looks like a required component for the code you're using: http://d3js.org/


1

@Koba NOTE: I do not know much about d3 (or) angular JS, having given this disclaimer, I think there is an issue with your data source you use to grab the data " https://secret.firebaseIO.com/secret" take a look at the below post : https://stackoverflow.com/questions/25025008/how-to-implement-javascript-within-salesforce-visual-force when I set all ...


Only top voted, non community-wiki answers of a minimum length are eligible