plotly / plotly/Plotly.NET

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

Đang mở
#441 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Area: Core API Area: MissingAbstraction Type: Enhancement
Ngôn ngữ chính
F#
Star
860
Fork
99
Merge trung bình
22 phút
Pull request đã merge (30 ngày)
1

Mô tả

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

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Hướng nghiên cứu

Bắt đầu với định dạng typed-array của Plotly.js v2.28.0 và so sánh với cách xử lý data_array hiện tại dựa trên IConvertible trong F# API và CSharp lib. Triển khai Python có thể cung cấp hướng dẫn về việc mã hóa; công việc được xem là hoàn tất khi các typed arrays đã mã hóa được hỗ trợ trong khuôn khổ công việc tương thích với Plotly.NET 6.0.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
csharp, javascript
Lĩnh vực
api
Loại issue
Tính năng
Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
25/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.