Commit Graph

90 Commits

Author SHA1 Message Date
Nathan Marrs
12a45fdeca Canvas: Refactor scene.tsx for better maintainability (#88517)
Co-authored-by: drew08t <drew08@gmail.com>
2024-06-13 03:33:42 +03:00
Nathan Marrs
9e82c85849 Canvas: Chore fix *remaining* betterer issues (#88491) 2024-05-31 13:33:31 -07:00
Nathan Marrs
99262c53b6 Canvas: Chore clean up betterer (#87477) 2024-05-09 10:59:49 -07:00
Nathan Marrs
5e4722fe2e Canvas: Fix canvas style regression (#87363) 2024-05-04 02:47:30 +03:00
Nathan Marrs
1ef1cc7e3f Canvas: Add support to rotate a group of elements (#87358) 2024-05-03 15:58:51 -07:00
Ashley Harrison
1d6d5cc2cd Chore: improve typings (#87306)
* some fixes

* some more fixes

* some canvas fixes

* use removeProperty instead

* few more

* fixy fix

* undo changes to ticks for now
2024-05-03 17:21:37 +01:00
Adela Almasan
eb86fd867f Canvas: Update new element type with rotation (#85690) 2024-04-11 15:36:33 -05:00
Nathan Marrs
b47f8b429e Canvas: Hide background image size editor options for SVG based elements (#85419) 2024-04-02 09:04:36 -07:00
Ihor Yeromin
20eac8d264 Canvas: Fix styles applying glitch on element type changing (#85184)
Co-authored-by: nmarrs <nathanielmarrs@gmail.com>
2024-03-29 08:10:44 +02:00
Nathan Marrs
26473a0074 Canvas: Add "infinite" pan / zoom functionality (#84968)
* attempt at solving issue and resetting bounds to match panel content

* cleanup failed experiments

* add toggle for infinite pan - dont love naming but open to suggestions; clean up scene transform function

* add ability to "infinite" zoom (i.e. render more canvas via zooming out)

* slight refactor

* revert refactor as it broke things
2024-03-22 21:38:45 +01:00
Nathan Marrs
566cee7d6b Canvas: Add ability to rotate elements (#83295) 2024-03-22 13:00:50 -07:00
Drew Slobodnjak
0b4830ccfd Canvas: Add corner radius option (#84873)
* Canvas: Add corner radius option

* Update connection radius logic

* Simplify angle calcs

* Simplify math to be a bit more clear and efficient

* Add checks for hyperbola behavior

* Prevent arc calcs if no radius

* Add comments for SOME clarity

* Add some more clarity to comments

* Fix linter issue

* Check for segment overlap for first vertex

* Update public/app/plugins/panel/canvas/components/connections/ConnectionSVG.tsx

* Add comment for calc clarity
2024-03-22 12:32:12 -07:00
Ihor Yeromin
8b32073d5f Canvas: New basic elements (#84205)
* feat(canvas): new canvas shapes added
2024-03-21 15:23:35 +01:00
Drew Slobodnjak
3877d976d6 Canvas: Add snapping to vertex edit (#84417)
* Canvas: Add vertex control to connections

* Add function for vertex conversion

* Add vertex interface

* Add future vertex handling

* Only show vertices when connection selected

* Add vertices to save model

* Apply select constraint to first midpoint

* Add some infrastructure for vertex edit

* Render vertex edit and capture events

* Save vertex edit on button release

* Handle adding new vertices

* Limit number of vertices to 10

* Handle zoom for vertex edit and creation

* Rename future to add

* Remove more references to future

* Remove unsued console log

* Clean up styles

* Add some clarity for path generation

* Add clarity to connections event handling

* Canvas: Add snapping to vertex edit

* Remove unused color styling

* Add horizontal and vertical snap for vertex edit

* Add snapping during vertex creation

* Hide vertex before removal
2024-03-20 23:49:28 -07:00
Drew Slobodnjak
f273681956 Canvas: Add vertex control to connections (#83653)
* Canvas: Add vertex control to connections

* Add function for vertex conversion

* Add vertex interface

* Add future vertex handling

* Only show vertices when connection selected

* Add vertices to save model

* Apply select constraint to first midpoint

* Add some infrastructure for vertex edit

* Render vertex edit and capture events

* Save vertex edit on button release

* Handle adding new vertices

* Limit number of vertices to 10

* Handle zoom for vertex edit and creation

* Rename future to add

* Remove more references to future

* Remove unsued console log

* Clean up styles

* Add some clarity for path generation

* Add clarity to connections event handling

---------

Co-authored-by: nmarrs <nathanielmarrs@gmail.com>
2024-03-15 09:35:07 -07:00
Nathan Marrs
9573c13223 Canvas: Add universal data link support (#84142) 2024-03-13 19:30:12 +02:00
Nathan Marrs
38a0eab137 Canvas: Fix datalink positioning glitch (#83869) 2024-03-05 15:23:10 -08:00
Adela Almasan
32a1f3955a Canvas: Keep tooltip open until dismissed (#82213) 2024-02-09 09:09:34 -06:00
Nathan Marrs
b0130ecb82 Canvas: Add element snapping and alignment (#80407)
Co-authored-by: drew08t <drew08@gmail.com>
Co-authored-by: Isabel <76437239+imatwawana@users.noreply.github.com>
2024-01-30 15:37:46 -08:00
Nathan Marrs
8784052ccf Canvas: Pan zoom minor refactor (#80337)
* enable context menu for canvas while in panel edit mode

* Disable context menu when editing is not enabled in canvas

* follow up minor refactor
2024-01-18 19:05:15 -08:00
renovate[bot]
a4b2b86194 Update Moveable (#73726)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2024-01-17 12:00:41 -08:00
Nathan Marrs
c40b2f90ba Canvas: Support context menu in panel edit mode (#80335) 2024-01-11 19:41:19 +02:00
Drew Slobodnjak
2502fe4d19 Canvas: Add Pan and Zoom (#76705)
* Canvas: Add Zoom

* Scale selecto components based on zoom state

* Fix pan by reverting to 3.1.0 for zoom-pan

* Update to latest library that fixes pan regression

* Add mini map to canvas pan zoom

* Fix selecto and anchors on hover

* Update naming to be more clear

* Switch back to contentComponent

* Apply transformScale to drag and resize

* Update connection source and target scaling

* Add option to display mini map

* Update yarn lock

* Revert "Update yarn lock"

This reverts commit 3d1dd65d57.

* Set yarn lock to main

* Revert "Set yarn lock to main"

This reverts commit 64bc50557e.

* Update to Yarn 4

* Add react-zoom-pan-pinch

* Update react-zoom-pan checksum

* Revert changes to json files

* Remove last line of api merged

* Remove last lines of all impacted jsons

* Update home json

* Update coordinate calc function to include scale

* Fix types in coordinate calc function

* Fix util calculation for transform

* Fix arrow anchor shift behavior

* Fix scale offset when adding elements during zoom

* Fix drag of selected group during zoom

* Add feature flag for canvas pan zoom

* Revert "Add feature flag for canvas pan zoom"

This reverts commit b026e31d8d.

* Regenerate feature flag after merge

* Apply feature flag to enable pan zoom wrappers

* Add mini map toggle behind feature flag

* Simplify minimap behavior

* Update feature flag registry

* Set minimap to false by default

* fix gen-cue

* Set toggles gen to main

Add blank line to toggle gen csv

* Add canvas pan zoom to csv

* Remove old comment

* Change ref parameter to be more descriptive

* Rename visibleFun to be more descriptive

* Consolidate transformScale transformRef in util

* Remove non-null assertion on connection parentRect

* Consolidate parentRect null coalescing into object

* Remove minimap and change toggle

* Add controls inline help for pan and zoom

* Clean up mouse events

* Pull scale out of ref and isolate transform

* Remove transform ref from scene div

* Fix context menu visible behavior

* Fix connections and update util functions

* Move transform component instance to util

* fix backend test

* minor updates

* Clean up connections / fix minor bug where offset of arrow wasn't being calculated correctly

* missed connection code cleanup

* cleanup scene code a bit more

* actually fix backend test

* move eslint disable line closer to actual issue

---------

Co-authored-by: nmarrs <nathanielmarrs@gmail.com>
2024-01-02 11:52:21 -08:00
Ashley Harrison
0c44a6f9bb Chore: Improve typings 🧹 (#74599)
* various type fixes

* candlestick panel type fixes

* few more fixes

* some fixes

* more :)

* moar!

* undo change to SilencesFilter

* undo change to configureStore
2023-09-13 09:17:07 +01:00
Ihor Yeromin
9e1f528919 A11y: Fix canvas element accessibility (#73483)
* fix(a11y): canvas tooltip element

* fix(a11y): canvas element selection
2023-08-21 21:34:47 +02:00
Ihor Yeromin
f169151143 A11y: Fix canvas setting button accessibility (#73413)
* fix(a11y): canvas setting button
2023-08-18 09:07:48 +02:00
Ashley Harrison
9852b24d61 Chore: Upgrade prettier to v3 (#71764)
* Update dependency prettier to v3 (#71586)

* Update dependency prettier to v3

* run prettier

* ignore prettier update in legacy select scss

* update command line arg

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>

* unplug prettier

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-07-17 15:58:22 +01:00
Ashley Harrison
5ca382c88a Revert "Update dependency prettier to v3 (#71586)" (#71755)
This reverts commit 2e8cd1c021.
2023-07-17 14:46:15 +01:00
renovate[bot]
2e8cd1c021 Update dependency prettier to v3 (#71586)
* Update dependency prettier to v3

* run prettier

* ignore prettier update in legacy select scss

* update command line arg

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
2023-07-17 09:19:27 +01:00
Ashley Harrison
7a2a5dde8b Chore: Enable remaining jsx-a11y rules (#70990)
enabling remaining a11y rules + ignore existing violations
2023-06-30 16:58:16 +01:00
Nathan Marrs
186cd96447 Canvas: Fix exit panel edit mode issue (#69315)
Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2023-06-01 01:31:10 +03:00
Nathan Marrs
f49b9b89cf chore: high level restructure of canvas panel files (#69004) 2023-05-24 18:32:36 +02:00
Ryan McKinley
854d497f94 Schema: Fix dimension schemas (#67935) 2023-05-05 12:16:31 -07:00
Adela Almasan
12e5101b91 Canvas: Connection properties based on data (#64360)
Co-authored-by: nmarrs <nathanielmarrs@gmail.com>
2023-04-25 10:31:45 -07:00
Adela Almasan
21ede347cb Canvas: Remove deleted connections from source (#65321) 2023-03-27 19:51:56 +03:00
Adela Almasan
58c9618160 Canvas: Update connection info on element rename (#62532) 2023-01-30 22:36:57 -06:00
Adela Almasan
a92c081a33 Canvas: Connections positioning ux improvements (#62516) 2023-01-30 15:50:10 -06:00
Nathan Marrs
6c9174a766 Canvas: Fix connection anchors for svg elements (#61895) 2023-01-25 16:32:04 -08:00
Adela Almasan
cef15873d6 Canvas: Add tooltip for data links (#61648) 2023-01-20 16:26:51 +00:00
Nathan Marrs
b1a24232e4 Canvas: Add support for basic arrows (#57561)
Co-authored-by: Ryan McKinley <ryan.mckinley@grafana.com>
Co-authored-by: Adela Almasan <adela.almasan@grafana.com>
Co-authored-by: Drew Slobodnjak <drew.slobodnjak@grafana.com>
2023-01-13 02:38:00 +00:00
Adela Almasan
a2bd85963c Canvas: Update element(s) selection after action (#61204) 2023-01-10 09:26:53 -06:00
Adela Almasan
88a8cba6b0 Canvas: Save element placement (#61007) 2023-01-04 18:29:01 -05:00
Nathan Marrs
fd6edbf8c5 Canvas: Improve disabled inline editing UX (#58610) 2022-11-10 13:04:42 -08:00
Adela Almasan
9c7b6b1ce8 Canvas: Extend root context menu (#58097) 2022-11-03 17:30:12 +00:00
Nathan Marrs
ff7225745a Canvas: Add metric value element type (#55205) 2022-09-22 10:21:45 -07:00
Adela Almasan
89d94eeab2 Canvas: Refine element duplication (#55050) 2022-09-12 14:33:08 -05:00
Adela Almasan
37a0207463 Canvas: Phantom mouse down fix (#54673) 2022-09-02 12:58:49 -07:00
Nathan Marrs
acbbdccba9 Canvas: Fix minor duplication bug #54462 2022-08-30 08:27:00 -07:00
Adela Almasan
6c58ea66a9 Canvas: Fix inconsistent border behavior (#53262) 2022-08-03 16:23:08 -05:00
Adela Almasan
5797fbc0b2 Canvas: Cleanup default elements (#52958) 2022-08-01 15:34:05 -05:00