Skip to content

Commit a255c78

Browse files
[autofix.ci] apply automated fixes
1 parent 7a82c32 commit a255c78

File tree

5 files changed

+32
-62
lines changed

5 files changed

+32
-62
lines changed

app/components/Chart/PatternSlot.vue

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -5,37 +5,36 @@
55
* Using patterns helps users with vision deficency (like achromatopsia) to distinguish
66
* series in the context of data visualisation.
77
*/
8-
import { computed } from "vue";
8+
import { computed } from 'vue'
99
import { createSeededSvgPattern } from '~/utils/charts'
1010
1111
const props = defineProps<{
12-
id: string
13-
seed: string | number
14-
color?: string
15-
foregroundColor: string
16-
fallbackColor: string
17-
maxSize: number
18-
minSize: number
12+
id: string
13+
seed: string | number
14+
color?: string
15+
foregroundColor: string
16+
fallbackColor: string
17+
maxSize: number
18+
minSize: number
1919
}>()
2020
2121
const pattern = computed(() =>
22-
createSeededSvgPattern(props.seed, {
22+
createSeededSvgPattern(props.seed, {
2323
foregroundColor: props.foregroundColor,
2424
backgroundColor: props.color ?? props.fallbackColor,
2525
minimumSize: props.minSize,
2626
maximumSize: props.maxSize,
27-
}),
27+
}),
2828
)
29-
3029
</script>
3130

3231
<template>
33-
<pattern
34-
:id
35-
patternUnits="userSpaceOnUse"
36-
:width="pattern.width"
37-
:height="pattern.height"
38-
:patternTransform="`rotate(${pattern.rotation})`"
39-
v-html="pattern.contentMarkup"
40-
/>
41-
</template>
32+
<pattern
33+
:id
34+
patternUnits="userSpaceOnUse"
35+
:width="pattern.width"
36+
:height="pattern.height"
37+
:patternTransform="`rotate(${pattern.rotation})`"
38+
v-html="pattern.contentMarkup"
39+
/>
40+
</template>

app/components/Compare/FacetBarChart.vue

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,6 @@ const config = computed<VueUiHorizontalBarConfig>(() => {
238238
},
239239
}
240240
})
241-
242241
</script>
243242

244243
<template>
@@ -328,4 +327,4 @@ const config = computed<VueUiHorizontalBarConfig>(() => {
328327
margin: 0 auto;
329328
height: 2rem;
330329
}
331-
</style>
330+
</style>

app/utils/charts.ts

Lines changed: 8 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -807,10 +807,9 @@ function createDeterministicRandomGenerator(seedNumber: number): () => number {
807807
// Second mixing step:
808808
// - Combine current value with another transformed version of itself
809809
// - Multiply again to increase entropy and spread bits
810-
intermediateValue ^= intermediateValue + Math.imul(
811-
intermediateValue ^ (intermediateValue >>> 7),
812-
intermediateValue | 61,
813-
)
810+
intermediateValue ^=
811+
intermediateValue +
812+
Math.imul(intermediateValue ^ (intermediateValue >>> 7), intermediateValue | 61)
814813

815814
// Final step:
816815
// - Final XOR with shifted value for additional scrambling
@@ -820,10 +819,7 @@ function createDeterministicRandomGenerator(seedNumber: number): () => number {
820819
}
821820
}
822821

823-
function pickValue<T>(
824-
values: NonEmptyReadonlyArray<T>,
825-
generateRandomNumber: () => number,
826-
): T {
822+
function pickValue<T>(values: NonEmptyReadonlyArray<T>, generateRandomNumber: () => number): T {
827823
const selectedIndex = Math.floor(generateRandomNumber() * values.length)
828824
const selectedValue = values[selectedIndex]
829825
if (selectedValue === undefined) {
@@ -924,15 +920,7 @@ export function createSeededSvgPattern(
924920
opacity,
925921
),
926922
createLineElement(0, tileSize, tileSize, 0, foregroundColor, strokeWidth, opacity),
927-
createLineElement(
928-
0,
929-
tileSize * 2,
930-
tileSize * 2,
931-
0,
932-
foregroundColor,
933-
strokeWidth,
934-
opacity,
935-
),
923+
createLineElement(0, tileSize * 2, tileSize * 2, 0, foregroundColor, strokeWidth, opacity),
936924
].join('')
937925
break
938926
}
@@ -973,24 +961,8 @@ export function createSeededSvgPattern(
973961
strokeWidth,
974962
opacity,
975963
),
976-
createLineElement(
977-
0,
978-
0,
979-
tileSize,
980-
tileSize,
981-
foregroundColor,
982-
strokeWidth * 0.75,
983-
opacity,
984-
),
985-
createLineElement(
986-
tileSize,
987-
0,
988-
0,
989-
tileSize,
990-
foregroundColor,
991-
strokeWidth * 0.75,
992-
opacity,
993-
),
964+
createLineElement(0, 0, tileSize, tileSize, foregroundColor, strokeWidth * 0.75, opacity),
965+
createLineElement(tileSize, 0, 0, tileSize, foregroundColor, strokeWidth * 0.75, opacity),
994966
].join('')
995967
break
996968
}
@@ -1057,4 +1029,4 @@ export function createSeededSvgPattern(
10571029
patternType,
10581030
contentMarkup,
10591031
}
1060-
}
1032+
}

test/nuxt/a11y.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2159,8 +2159,8 @@ describe('component accessibility audits', () => {
21592159
foregroundColor: 'black',
21602160
fallbackColor: 'transparent',
21612161
maxSize: 24,
2162-
minSize: 16
2163-
}
2162+
minSize: 16,
2163+
},
21642164
})
21652165
const results = await runAxe(component)
21662166
expect(results.violations).toEqual([])

test/unit/app/utils/charts.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import {
1515
sanitise,
1616
insertLineBreaks,
1717
applyEllipsis,
18-
createSeedNumber,
18+
createSeedNumber,
1919
createSeededSvgPattern,
2020
type TrendLineConfig,
2121
type TrendLineDataset,
@@ -1559,4 +1559,4 @@ describe('createSeededSvgPattern', () => {
15591559
const stringSeedResult = createSeededSvgPattern('12345')
15601560
expect(numericSeedResult).toEqual(stringSeedResult)
15611561
})
1562-
})
1562+
})

0 commit comments

Comments
 (0)