Security News
New Python Packaging Proposal Aims to Solve Phantom Dependency Problem with SBOMs
PEP 770 proposes adding SBOM support to Python packages to improve transparency and catch hidden non-Python dependencies that security tools often miss.
otter-chart
Advanced tools
基于lightweight-charts开发的图表库,覆盖了lightweight-charts
的所有能力,并基于lightweight-charts
的API
进行了一些扩展,使其更加适合在OtterTrade
项目中使用。
npm install otter-chart # or yarn add otter-chart or pnpm add otter-chart
可在浏览器中直接引入,也可在
webpack、vite
等打包工具中引入。其中浏览器中直接引入时,会挂载到window.OtterChart
对象上
默认导出了lightweight-charts
的所有能力,使用方式与lightweight-charts
一致,只是将lightweight-charts
替换为otter-chart
即可。
initChart
:带有默认配置的图表初始化方法
csvToJson
: 将csv
数据转换为json
数据
fileToJson
:将csv
格式的文件类型转换为json
数据
time
时间类型为unix
时间戳,单位为秒
//类型定义
export type ChartDataType = {
close: number | string;
high: number | string;
low: number | string;
open: number | string;
time: UTCTimestamp;
volume: number | string;
};
//示例值为:
{
close: '7185.88',
high: '7195.52',
low: '7183.0',
open: '7195.36',
time: 1577835000,
volume: '696.1179999999999',
},
//类型定义
export type OrderDataType = {
balance: number | string;
drawdown: number | string;
price: number | string;
quantity: number | string;
time: UTCTimestamp;
type: 'BUY' | 'SELL';
};
//示例值为:
{
balance: '664.04',
drawdown: '36.79',
price: '7081.79',
quantity: '0.093',
time: 1576479600,
type: 'BUY',
}
// webpack相关项目中使用
import { initChart } from 'otter-chart';
// initChart的首要参数为需要初始化的domId值或者dom实例
const { chart } = initChart('chart', {
width: 1000,
height: 350,
});
chart.setChartData(chartData);
chart.setOrderData(orderData);
FAQs
otter-chart图表库
We found that otter-chart demonstrated a healthy version release cadence and project activity because the last version was released less than 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
PEP 770 proposes adding SBOM support to Python packages to improve transparency and catch hidden non-Python dependencies that security tools often miss.
Security News
Socket CEO Feross Aboukhadijeh discusses open source security challenges, including zero-day attacks and supply chain risks, on the Cyber Security Council podcast.
Security News
Research
Socket researchers uncover how threat actors weaponize Out-of-Band Application Security Testing (OAST) techniques across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.