Commit Graph

139 Commits

Author SHA1 Message Date
Ashley Harrison
47f8717149 React: Use new JSX transform (#88802)
* update eslint, tsconfig + esbuild to handle new jsx transform

* remove thing that breaks the new jsx transform

* remove react imports

* adjust grafana-icons build

* is this the correct syntax?

* try this

* well this was much easier than expected...

* change grafana-plugin-configs webpack config

* fixes

* fix lockfile

* fix 2 more violations

* use path.resolve instead of require.resolve

* remove react import

* fix react imports

* more fixes

* remove React import

* remove import React from docs

* remove another react import
2024-06-25 12:43:47 +01:00
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
Ashley Harrison
c151a97110 Chore: Enable no-unreduced-motion and fix errors (#86572)
* enable `no-unreduced-motion` in betterer

* move all animation calls inside handleReducedMotion

* fix violations + enable rule

* update rule README

* remove unnecessary transition from <Collapse>

* remove handleReducedMotion utility and add handleMotion to theme

* update to use new theme value

* handle Dropdown and IconButton

* handle AppChromeMenu and update lint message

* keep rotation at a reduced speed

* handle DashboardLoading
2024-04-29 13:12:36 +01:00
Nathan Marrs
5dea949433 Canvas: Match connection anchor points to elements (#85421)
Co-authored-by: Ihor Yeromin <yeryomin.igor@gmail.com>
2024-04-23 14:26:53 -07:00
Drew Slobodnjak
ed8eacbc7e Canvas: Fix division by zero (#85443)
* Canvas: Fix division by zero

* Fix last add vertex control

* Apply fix to existing vertices

* Apply deltas to temporary paths

* Persist original source and target coorindates

* Add follow up TODO

* Update connection svg to handle originals

* Get rid of minimum constraints for deltas

* Apply persist coordinate system to vertex handlers

* Consolidate and rename selected value

* Update connection arcs to use new coordinates

* fix editor crashing with scenes

---------

Co-authored-by: Adela Almasan <adela.almasan@grafana.com>
2024-04-17 10:18:17 -07:00
Adela Almasan
eb86fd867f Canvas: Update new element type with rotation (#85690) 2024-04-11 15:36:33 -05:00
Adela Almasan
883a41e8aa Canvas: Add support for line animation (#85556) 2024-04-05 17:53:40 +03:00
Ihor Yeromin
5a53041c49 Canvas: Fix SVG element border clipped (#85590)
fix(canvas): canvas svg element border clipped
2024-04-04 20:08:24 +02: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
Ihor Yeromin
726a666059 Canvas: Fix SVG items background glitch (#85078) 2024-03-29 00:26:59 +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
Drew Slobodnjak
c1065e6e68 Canvas: Add direction options for connections (#84620)
* Canvas: Add direction options for connections

* Fix radio control to handle default

* Fix broken options from merge

* Remove unused comment

* Change category and capitalize options for arrow

* Consolidate marker start and end for connections

* Fix linter issue
2024-03-21 11:38:17 -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
Ihor Yeromin
3c97476390 Canvas: Support dashed connection lines (#84496)
* feat(canvas): add connection types
2024-03-19 17:56:10 +01: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
5c27d28ba4 Canvas: Add datalink support to rectangle and ellipse elements (#83870) 2024-03-05 15:25:12 -08: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
Drew Slobodnjak
9116043453 Storage: Add maxFiles to list functions (#76414)
* Storage: Add maxFiles to list functions

* Add maxDataPoints argument to listFiles function

* Add maxFiles to ResourceDimensionEditor

* Update pkg/services/store/http.go

* rename First to Limit

---------

Co-authored-by: jennyfana <110450222+jennyfana@users.noreply.github.com>
Co-authored-by: nmarrs <nathanielmarrs@gmail.com>
Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2023-11-01 09:42:24 -07:00
Nathan Marrs
124bf6bfa9 chore: canvas cleanup betterer styles object notation edition (#76315)
Co-authored-by: drew08t <drew08@gmail.com>
2023-11-01 18:25:26 +02:00
Adela Almasan
3ba78c45d1 Canvas: Promote Button to beta (#76582) 2023-10-14 01:59:12 +03:00
Adela Almasan
d5945bc26e Canvas: Button API Editor visual feedback on response (#76499) 2023-10-13 08:11:08 +03:00
Nathan Marrs
6184bf21e2 Canvas: Add standard text config options to button element (#76160)
Co-authored-by: Adela Almasan <adela.almasan@grafana.com>
2023-10-11 01:53:56 +03:00
Nathan Marrs
bd5d67ed28 Canvas: Add ability to customize what standard element editors show up for all element types (#75935)
Co-authored-by: Adela Almasan <adela.almasan@grafana.com>
2023-10-05 12:58:35 -07:00
Linghao Su
549acf09b1 Canvas: Fix button element size not being applied correctly (#75387)
Co-authored-by: Nathan Marrs <nathanielmarrs@gmail.com>
2023-10-03 21:32:58 -07:00
Linghao Su
b5da762477 Canvas: Fix inconsistent element placement when changing element type (#74942)
Co-authored-by: Nathan Marrs <nathanielmarrs@gmail.com>
2023-09-21 23:36:02 +03:00
Adela Almasan
5caf4e1485 Canvas: Button API Editor support template variables (#74779) 2023-09-19 00:16:21 +03:00
Adela Almasan
7171b35095 Canvas: Avoid conflicting stylesheets when loading SVG icons (#74461) 2023-09-18 17:38:45 +00:00
Adela Almasan
0815d7f627 Canvas: Button API Editor support setting parameters (#74637) 2023-09-18 09:25:35 -05:00
Adela Almasan
59b7789ada Canvas: Add support for selecting the button variant (#74782) 2023-09-14 12:20:58 -05:00
Adela Almasan
a0e6e76ca6 Canvas: Button API Editor support setting content-type (#74682) 2023-09-14 10:17:21 -05: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
d6bddf3c68 Canvas: New circle/ellipse element (#74389)
* feat(canvas): add circle element
2023-09-12 15:56:48 +02:00
Adela Almasan
89127d5ec9 Canvas: Button API - Add support for GET requests (#74566) 2023-09-11 08:03:52 -05: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