plotly / plotly/react-plotly.js
Localization
未關閉
還沒有人認領這個 Issue。
- 主要語言
- JavaScript
- 星號
- 1.1k
- 分支
- 138
- 平均合併
- 3 天 2 小時
- 30 天內合併 PR
- 4
描述
Hello 👋
I am having trouble with localization.
I have looked at plotly.js tests for some inspiration and I've seen that config.locale and config.locales are being set here and passed to newPlot fn. But it didn't really help me.
My Chart components looks like this:
import * as Plotly from 'plotly.js'
import * as csDictionary from 'plotly.js/lib/locales/cs.js'
import * as React from 'react'
import * as Plot from 'react-plotly.js'
Plotly.register(csDictionary)
Plotly.setPlotConfig({ locale: 'cs' })
const trace1 = {
x: [0, 1, 2],
y: [1, 1, 1],
mode: 'lines+markers+text',
name: 'Lines, Markers and Text',
text: ['Text A', 'Text B', 'Text C'],
textposition: 'top right',
textfont: {
family: 'sans serif',
size: 18,
color: '#1f77b4',
},
type: 'scatter',
}
class Chart extends React.Component {
render() {
return (
<Plot
config={{ locale: 'cs' }}
data={[trace1]}
layout={{
width: 800,
height: 400,
title: 'A Fancy Plot',
}}
/>
)
}
}
export default Chart
❓ Any ideas how to make this work?
Localization is crucial for me and it looks that it is somehow supported, but I just cannot figure how to set it up.
Thanks 🙏
貢獻指南
這個儲存庫沒有索引到貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
研究方向
首先重現 issue 中所示的在地化設定,包括 Plotly.register、Plotly.setPlotConfig、config.locale 和 React Chart component。比較設定的 locale 與算繪出的圖表,並判斷讓捷克語在地化運作所需的變更;當圖表的在地化 UI 明顯套用時,即表示完成。
由索引模型根據 Issue 內容生成。
評估
- 技術堆疊
- javascript, react, typescript
- 領域
- data-visualization, frontend, internationalization
- Issue 類型
- 缺陷
- 難度
- 3/5
- 預估耗時
- 1-2 天
- 活躍度
- 停滯
- 描述清晰度
- 需要釐清
- 新手友好度
- 25/100