plotly / plotly/Plotly.NET

plotly.js v2.28.0 compatibility needs huge rework of core API

未关闭
#441 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

Area: Core API Area: MissingAbstraction Type: Enhancement
主要语言
F#
星标
860
派生
99
平均合并
22 分钟
30 天内合并 PR
1

描述

https://github.com/plotly/plotly.js/releases/tag/v2.28.0 introduces an option to set objects for encoded typedarrays for basically all fields that provide data to traces (e.g. x and y for a cartesian plot).

an object with keys dtype, bdata, and optionally shape. In this 3rd form, dtype is one of f8, f4. i4, u4, i2, u2, i1, u1 or u1c for Uint8ClampedArray. In addition to shorthand dtype above one could also use the following forms: float64, float32, int32, uint32, int16, uint16, int8, uint8 or uint8c for Uint8ClampedArray. bdata is either a base64-encoded string or the ArrayBuffer of an integer or float typed array. For either multi-dimensional arrays you must also provide its dimensions separated by comma via shape. For example using dtype: f4 and shape: 5,100 you can declare a 2-D array that has 5 rows and 100 columns containing float32 values i.e. 4 bits per value. shape is optional for one dimensional arrays.

Plotly.NET's API is statically typed and currently uses sequences of #IConvertible for these fields. This was a clever trick because this allows setting any of the CLR runtime types Boolean, SByte, Byte, Int16, UInt16, Int32, UInt32, Int64, UInt64, Single, Double, Decimal, DateTime, Char, and String while also making it very easy to serialize.

The new way of setting data_arrays seems to have speed advantages, and is therefore worth to be supported well from our side. A straightforward way of implementing this in the API providing a new type, e.g.

type EncodedTypedArray {
    bdata: <string or maybe byte []?>
    dtype: <some type abstraction>
    shape: <some shape abstraction>
}

this type would also need functionality to encode the base64 string in a way that is understood by plotly.js. Maybe the python implementation's codebase can help here, as they seem to implement these functions as well.

Due to these large changes that also must be reflected on the CSharp lib, support for plotly.js >= v2.28.0 will be moved to the major release of Plotly.NET 6.0

贡献指南

这个仓库没有索引到贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

从 Plotly.js v2.28.0 的 typed-array 格式开始,并将其与 F# API 和 CSharp lib 中当前基于 IConvertible 的 data_array 处理进行比较。Python 实现可能会为编码提供指导;在 Plotly.NET 6.0 兼容性工作中支持编码后的 typed arrays 即表示完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
csharp, javascript
领域
api
Issue 类型
功能
难度
5/5
预计耗时
一周以上
活跃度
停滞
描述清晰度
基本清楚
新手友好度
25/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。