Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
@refinitiv-ui/browser-sparkline
Advanced tools
Sparkline canvas that support both static data and Refinitiv Data Platform
Browser sparkline chart is a canvas chart component that supports both static data drawing mode and automatic retrieve the data from Refinitiv Data Platform.
npm run start
Browser sparkline chart can be added to your app as per any web component.
<browser-sparkline-chart id="chart"></browser-sparkline-chart>
const chart = document.getElementById('chart');
chart.config = {
themeConfig: {
lineWidth: 1,
upperLineColor: '#39C46E',
lowerLineColor: '#D94255',
},
requestData: {
ric: 'A',
interval: '1H',
timeFrame: '2D',
view: 'BID',
}
};
For chart configuration, you can use these configuration preperties below (All these properties can be optional)
const chart = document.getElementById('chart');
chart.config = {
themeConfig: {
width: 200,
height: 100,
lineWidth: 1,
referenceLineColor: '#4D4D4D',
previousLineColor: '#BFBFBF',
upperLineColor: '#39C46E',
lowerLineColor: '#D94255',
fillColorStyle: 'solid'
},
};
All these properties can be optional
Create the chart with static data without retrieve the data from Refinitiv Data Platform.
const chart = document.getElementById('chart');
chart.config = {
staticData: {
referenceValue: 0,
previousData: [-3, 6, 4, 5, 0, 3, 2, 3, -1, -4, 2, 3, 4, 3, 6],
data: [-2, -3, 1, 1, 4, 6, -3, 1, 4, 6, 10, 5, 0, 3, 2, 3]
},
};
Prior to the usage of Browser Spakline Chart with streaming value with view
preperty, ensure your project include RTK with Quotes plugin.
Quotes plugin is required for obtaining real-time market data to add the lastest data point to the chart when the current day is trading day.
const chart = document.getElementById('chart');
chart.config = {
requestData: {
ric: 'A',
timeFrame: '5D',
view: 'YIELD',
},
};
ric - RIC name
timeFrame (optional) - Time range to retrieve the data from Refinitiv Data Platform API for display on the sparkline chart. The default timeFrame is 2D.
interval (optional) - Calendar day interval to retrieve the data from Refinitiv Data Platform API. The default interval is 1H.
previousLine (optional) - Range of previous data to draw sparkline with previous line color. PreviousLine use the same pattern as timeFrame. The default previousLine value is 0D. For example:
const chart = document.getElementById('chart');
chart.config = {
requestData: {
ric: 'A',
timeFrame: '5D',
previousLine: '2D',
},
};
In this case DAY1 - DAY2 data points will be previous line color and DAY3 - DAY5(today) data points will be normal line color.
view (optional) - View preperty required RTK with Quotes plugin to subscribe to add on the chart. The default value is depend on default view from Time Series backend service or the custom endpoint from defaultViewUrl
.
defaultViewUrl (optional) - Url endpoint is required to get the default view ('BID', 'BID_YIELD', etc.) to subscribe quote to use for streaming point. The default url is /Apps/TAService/GetMetaData/
.
dataPointUrl (optional) - Url endpoint is required to get the initial data point to add on the chart. The default url is /Apps/TAService/GetTimeSeries
.
autoFetch (optional) - Auto fetch is a flag that's set to handle about re-fetching the data from the server when RTK with Quotes plugin isn't available. The default value is true
Browser sparkline chart have public medthod to update browser-sparkline-canvas
size. Default width is 100px and default height is 30px.
const chart = document.getElementById('chart');
chart.updateCanvasSize(200, 100);
FAQs
Sparkline canvas that support both static data and Refinitiv Data Platform
The npm package @refinitiv-ui/browser-sparkline receives a total of 186 weekly downloads. As such, @refinitiv-ui/browser-sparkline popularity was classified as not popular.
We found that @refinitiv-ui/browser-sparkline demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.