Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@statisticsfinland/pxvisualizer",
"version": "1.1.3",
"version": "1.1.4",
"description": "Component library for visualizing PxGraf data",
"main": "./dist/pxv.cjs",
"jestSonar": {
Expand Down
6 changes: 3 additions & 3 deletions src/core/chartOptions/Utility/seriesDataBuilder.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ describe('Highcharts series builder tests', () => {
backgroundColor: "#1a56ec",
height: 10,
path: {
d: "M -2 -2 L 12 12 M -12 -2 L 2 12 M -2 -12 L 12 2",
d: "M 0 5 L 10 5 M 5 0 L 5 10",
stroke: "white",
strokeWidth: 2,
},
Expand Down Expand Up @@ -124,7 +124,7 @@ describe('Highcharts series builder tests', () => {
backgroundColor: "#f2644c",
height: 10,
path: {
d: "M -2 12 L 12 -2 M -12 12 L 2 -2 M -2 22 L 12 8",
d: "M 0 0 L 10 10 M 10 0 L 0 10",
stroke: "white",
strokeWidth: 2,
},
Expand Down Expand Up @@ -161,7 +161,7 @@ describe('Highcharts series builder tests', () => {
backgroundColor: "#1a56ec",
height: 10,
path: {
d: "M -2 -2 L 12 12 M -12 -2 L 2 12 M -2 -12 L 12 2",
d: "M 0 5 L 10 5 M 5 0 L 5 10",
stroke: "white",
strokeWidth: 2,
},
Expand Down
41 changes: 25 additions & 16 deletions src/core/highcharts/fillPatterns.ts
Original file line number Diff line number Diff line change
@@ -1,37 +1,46 @@
export const defaultFillPatterns = [
// Grid (Crosshatch)
'M 0 5 L 10 5 M 5 0 L 5 10',

// Diagonal grid (Crosshatch)
'M 0 0 L 10 10 M 10 0 L 0 10',

// Small grid
'M 2,2 h1 v1 h-1 z M 7,7 h1 v1 h-1 z M 2,7 h1 v1 h-1 z M 7,2 h1 v1 h-1 z',

// Dots
'M 2,2 h1 v1 h-1 z M 7,7 h1 v1 h-1 z',

// Diagonal stripes (right)
'M -2 -2 L 12 12 M -12 -2 L 2 12 M -2 -12 L 12 2',

// Diagonal stripes (left)
'M -2 12 L 12 -2 M -12 12 L 2 -2 M -2 22 L 12 8',

// Vertical stripes
'M 5 0 L 5 10',

// Horizontal stripes
'M 0 5 L 10 5',

// Grid (Crosshatch)
'M 0 5 L 10 5 M 5 0 L 5 10',

// Dots
'M 2,2 h1 v1 h-1 z M 7,7 h1 v1 h-1 z',
// Concentric circles
'M 5,5 m -3,0 a 3,3 0 1,0 6,0 a 3,3 0 1,0 -6,0',

// Waves
'M 0 5 Q 2.5 0, 5 5 T 10 5',
// Dot grid
'M 2 2 L 3 3 M 7 7 L 8 8 M 2 7 L 3 8 M 7 2 L 8 3',

// Diamonds
'M 5 0 L 10 5 L 5 10 L 0 5 Z',

// Crosses
'M 2 5 L 8 5 M 5 2 L 5 8',

// Vertical stripes
'M 5 0 L 5 10',

// Horizontal stripes
'M 0 5 L 10 5',

// Waves
'M 0 5 Q 2.5 0, 5 5 T 10 5',

// Thiccc bars
'M 0 2 L 10 2 M 0 8 L 10 8',

// Triangles
'M 0 10 L 5 0 L 10 10 Z',

// Concentric circles
'M 5,5 m -3,0 a 3,3 0 1,0 6,0 a 3,3 0 1,0 -6,0',
];
11 changes: 7 additions & 4 deletions src/react/components/burgerMenu/burgerMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -315,8 +315,8 @@ export const BurgerMenu: React.FC<IBurgerMenuProps> = ({ viewData, currentChartR

const handleKeyDown = (e: KeyboardEvent) => {
if (e.key === 'Escape' ||
(e.key === 'Tab' && isOpen)) {
toggleMenuOpen(false);
(e.key === 'Tab' && isOpen)) {
toggleMenuOpen(false, e.key === 'Escape');
}
if (e.key === 'ArrowDown' && isOpen) {
e.preventDefault();
Expand All @@ -338,12 +338,15 @@ export const BurgerMenu: React.FC<IBurgerMenuProps> = ({ viewData, currentChartR

const buttonRef = React.useRef<HTMLButtonElement>(null);
const handleMenuItemClick = (onClick?: () => void) => {
toggleMenuOpen(false);
toggleMenuOpen(false, true);
if (onClick) onClick();
}

const toggleMenuOpen = (open: boolean) => {
const toggleMenuOpen = (open: boolean, focusToMenuButton: boolean = false) => {
setIsOpen(open);
if (!open && focusToMenuButton) {
buttonRef.current?.focus();
}
}

const setFocusToMenuItem = () => {
Expand Down
Loading