[🎨Component] Create adjustInitialZoomScale function for setting an adequate zoom scale for the inputted data
Previously, no matter what the user inputs as the data (setData, setLayers), the zoom value was always set to 1. However, this did not help when users wanted to see pixel canvas with more than 100 rows or columns.
I thus created a function to adequately manipulate the zoom scale for the inputted data. Now, the user will be able to see the whole grid canvas initially
Optimize onmouseup interaction for drawing actions
[🪝Hooks] Remove data params from stroke end listener
Previously, strokeEndListener allowed users to get a new copied DottingData every time the user ends their stroke. However, I found that copying the whole data every time the users finishes interaction lagging when the data has more than 100 rows or columns. Thus I removed the data prams from strokeEndListener
[🎨Component] Lessen the usage of getCopiedData
I found that there were many places that used getCopiedData especially during interaction. This inevitably cause lots of lags when the data was too big. Thus, I decided to not use getCopiedData and just use the original data when emitting events.
getCopiedData is only used when there is a need to copy the current data to the interaction layer.
[📒Docs] Update stroke end listener example
Notes
Next Up?
I am going to find methods to optimize panning and zooming using drawImage
🚀 [Resolves #87]
Preview
https://github.com/hunkim98/dotting/assets/57612141/2311c80b-fc10-4f5f-a65c-b58bb23c9cb8
Changes
Adjust zoom scale to the inputted dimensions
[🎨Component] Create
adjustInitialZoomScale
function for setting an adequate zoom scale for the inputted datasetData
,setLayers
), the zoom value was always set to 1. However, this did not help when users wanted to see pixel canvas with more than 100 rows or columns.Optimize onmouseup interaction for drawing actions
[🪝Hooks] Remove data params from stroke end listener
DottingData
every time the user ends their stroke. However, I found that copying the whole data every time the users finishes interaction lagging when the data has more than 100 rows or columns. Thus I removed thedata
prams fromstrokeEndListener
[🎨Component] Lessen the usage of
getCopiedData
getCopiedData
especially during interaction. This inevitably cause lots of lags when the data was too big. Thus, I decided to not usegetCopiedData
and just use the original data when emitting events.getCopiedData
is only used when there is a need to copy the current data to the interaction layer.[📒Docs] Update stroke end listener example
Notes
Next Up?
I am going to find methods to optimize panning and zooming using
drawImage