Skip to content

Instantly share code, notes, and snippets.

@nautilytics
Last active March 13, 2020 15:06
Show Gist options
  • Save nautilytics/aa2f4642f1d6fca3c6ed56b3e2bdb538 to your computer and use it in GitHub Desktop.
Save nautilytics/aa2f4642f1d6fca3c6ed56b3e2bdb538 to your computer and use it in GitHub Desktop.
Example files for the creation of a React + d3.js application in a Salesforce Sandbox instance
global with sharing class EventController {
public String accountId {get; set;}
public EventController() {}
@RemoteAction
global static List<Event> findEvents(String accountId) {
return [SELECT Type, CreatedDate, Id from Events WHERE WhoId =:accountId];
}
}
{
"landing-pages": [
{
"path": "index.html",
"apex-controller": "LeadController"
}
]
}
{
"name": "sample_react_d3_app_salesforce",
"homepage": "./",
"scripts": {
"salesforce_build": "react-scripts build && cd build && zip -r SampleReactD3App.zip *",
}
}
<aura:component implements="flexipage:availableForAllPageTypes" access="global" controller="LeadController">
<lightning:card title="React D3 Sample">
<lightning:container
aura:id="sampleReactD3App"
src="{!$Resource.SampleReactD3App + '/index.html'}"
onmessage="{!c.handleMessage}"
onerror="{!c.handleError}"
/>
</lightning:card>
</aura:component>
.THIS iframe {
height: 500px;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment