Skip to content
This repository has been archived by the owner on Mar 28, 2024. It is now read-only.

[Feature request]Open: range to coordinate api #251

Closed
dream-num opened this issue Nov 20, 2020 · 4 comments
Closed

[Feature request]Open: range to coordinate api #251

dream-num opened this issue Nov 20, 2020 · 4 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@dream-num
Copy link
Collaborator

Is your feature request related to a problem? Please describe.
What I get through API: luckysheet.getRange() is the number of visit rows and columns of the current selection, {column: [0, 1], row: [0, 1]}

But I want to get something like A1:B2

Describe the solution you'd like
Open: range to coordinate api

@dream-num dream-num added good first issue Good for newcomers enhancement New feature or request labels Nov 20, 2020
@flowerField
Copy link
Contributor

flowerField commented Dec 2, 2020

Several schemes are given for reference. If there is a suitable one, code implementation is carried out.

Scheme 1: add the field axis to the selected area. The field type is string, and the value form is "A1" or "C1: C3".

contrast

Current returned data structure:

[{"row":[0,7],"column":[0,0]},{"row":[0,2],"column":[2,2]},{"row":[4,4],"column":[3,3]},{"row":[8,10],"column":[2,4]}]

Data structure returned after adjustment:

[{"row":[0,7],"column":[0,0],axis:"A1:A8"},{"row":[0,2],"column":[2,2],axis:"C1:C3"},{"row":[4,4],"column":[3,3],axis:"D5"},{"row":[8,10],"column":[2,4],axis:"C9:E11"}]

@flowerField
Copy link
Contributor

flowerField commented Dec 2, 2020

Scheme 2: replace row and column data with axis field data
Current returned data structure:

[{"row":[0,7],"column":[0,0]},{"row":[0,2],"column":[2,2]},{"row":[4,4],"column":[3,3]},{"row":[8,10],"column":[2,4]}]

Data structure returned after adjustment:

["A1:A8","C1:C3","D5","C9:E11"]

Of course, we can also consider adding the getRangeAxis API on the basis of retaining the original API, which returns the data of the above structure.

@flowerField
Copy link
Contributor

@i can solve it

@dream-num
Copy link
Collaborator Author

Great solution!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant