Skip to content

Commit a34ed83

Browse files
authored
fix reference passed to non-reference (needed for vlang/v#22194) (#220)
1 parent bdb5c39 commit a34ed83

File tree

81 files changed

+1126
-1132
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+1126
-1132
lines changed

examples/data_analysis_example/main.v

+14-14
Original file line numberDiff line numberDiff line change
@@ -86,23 +86,23 @@ fn main() {
8686

8787
// Add traces for each class in the 3D plot
8888
plt_3d.scatter3d(
89-
x: x1_class0
90-
y: x2_class0
91-
z: [][]f64{len: x1_class0.len, init: [0.0]}
92-
mode: 'markers'
89+
x: x1_class0
90+
y: x2_class0
91+
z: [][]f64{len: x1_class0.len, init: [0.0]}
92+
mode: 'markers'
9393
marker: plot.Marker{
94-
size: []f64{len: x1_class0.len, init: 8.0}
94+
size: []f64{len: x1_class0.len, init: 8.0}
9595
color: []string{len: x1_class0.len, init: 'blue'}
9696
}
9797
name: 'Class 0'
9898
)
9999
plt_3d.scatter3d(
100-
x: x1_class1
101-
y: x2_class1
102-
z: [][]f64{len: x1_class1.len, init: [0.0]}
103-
mode: 'markers'
100+
x: x1_class1
101+
y: x2_class1
102+
z: [][]f64{len: x1_class1.len, init: [0.0]}
103+
mode: 'markers'
104104
marker: plot.Marker{
105-
size: []f64{len: x1_class1.len, init: 8.0}
105+
size: []f64{len: x1_class1.len, init: 8.0}
106106
color: []string{len: x1_class1.len, init: 'red'}
107107
}
108108
name: 'Class 1'
@@ -134,14 +134,14 @@ fn main() {
134134
mut plt_bars := plot.Plot.new()
135135

136136
plt_bars.bar(
137-
x: []string{len: stat.mean_x.len, init: 'Class ${index}'}
138-
y: stat.mean_x
137+
x: []string{len: stat.mean_x.len, init: 'Class ${index}'}
138+
y: stat.mean_x
139139
name: 'Mean'
140140
)
141141

142142
plt_bars.bar(
143-
x: []string{len: stat.sig_x.len, init: 'Class ${index}'}
144-
y: stat.sig_x
143+
x: []string{len: stat.sig_x.len, init: 'Class ${index}'}
144+
y: stat.sig_x
145145
name: 'Standard Deviation'
146146
)
147147

examples/fft_plot_example/main.v

+6-6
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ fn main() {
2626

2727
// Add a scatter plot for the original signal
2828
plt.scatter(
29-
x: []f64{len: original_signal.len, init: f64(index)}
30-
y: original_signal
31-
mode: 'markers'
29+
x: []f64{len: original_signal.len, init: f64(index)}
30+
y: original_signal
31+
mode: 'markers'
3232
marker: plot.Marker{
3333
size: []f64{len: original_signal.len, init: 8.0}
3434
}
@@ -37,9 +37,9 @@ fn main() {
3737

3838
// Add a scatter plot for the imaginary part of the spectrum
3939
plt.scatter(
40-
x: []f64{len: spectrum.len, init: f64(index)}
41-
y: spectrum
42-
mode: 'markers'
40+
x: []f64{len: spectrum.len, init: f64(index)}
41+
y: spectrum
42+
mode: 'markers'
4343
marker: plot.Marker{
4444
size: []f64{len: spectrum.len, init: 8.0}
4545
}

examples/plot_annotated_pie_chart/main.v

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ fn main() {
88

99
mut plt := plot.Plot.new()
1010
plt.pie(
11-
labels: labels
12-
values: values
11+
labels: labels
12+
values: values
1313
textinfo: 'percent+label'
1414
)
1515
plt.layout(

examples/plot_basic_heatmap/main.v

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ fn main() {
1515
z: z
1616
)
1717
plt.layout(
18-
title: 'Heatmap Basic Implementation'
19-
width: 750
18+
title: 'Heatmap Basic Implementation'
19+
width: 750
2020
height: 750
2121
)
2222

examples/plot_bubble_chart/main.v

+4-4
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ fn main() {
99

1010
mut plt := plot.Plot.new()
1111
plt.scatter(
12-
x: x
13-
y: y
14-
mode: 'markers'
12+
x: x
13+
y: y
14+
mode: 'markers'
1515
marker: plot.Marker{
16-
size: size
16+
size: size
1717
color: []string{len: x.len * y.len, init: '#FF0000'}
1818
}
1919
name: 'Bubble Chart'

examples/plot_grouped_bar_chart/main.v

+4-4
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ fn main() {
99

1010
mut plt := plot.Plot.new()
1111
plt.bar(
12-
x: categories
13-
y: values1
12+
x: categories
13+
y: values1
1414
name: 'Group 1'
1515
)
1616
plt.bar(
17-
x: categories
18-
y: values2
17+
x: categories
18+
y: values2
1919
name: 'Group 2'
2020
)
2121
plt.layout(

examples/plot_heatmap_golden_ratio/main.v

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ fn main() {
3131
z: z
3232
)
3333
plt.layout(
34-
title: 'Heatmap with Unequal Block Sizes'
35-
width: 750
34+
title: 'Heatmap with Unequal Block Sizes'
35+
width: 750
3636
height: 750
3737
)
3838

examples/plot_histogram/main.v

+5-5
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,16 @@ fn main() {
1010

1111
mut plt := plot.Plot.new()
1212
plt.histogram(
13-
x: x
13+
x: x
1414
xbins: plot.Bins{
1515
start: 0.0
16-
end: 100.0
17-
size: 2
16+
end: 100.0
17+
size: 2
1818
}
1919
)
2020
plt.layout(
21-
title: 'Histogram Example'
22-
width: 750
21+
title: 'Histogram Example'
22+
width: 750
2323
height: 750
2424
)
2525
plt.show()!

examples/plot_line_axis_titles/main.v

+4-4
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,17 @@ fn main() {
1010

1111
mut plt := plot.Plot.new()
1212
plt.scatter(
13-
x: x
14-
y: y1
13+
x: x
14+
y: y1
1515
mode: 'lines'
1616
line: plot.Line{
1717
color: '#FF0000'
1818
}
1919
name: 'sin(x)'
2020
)
2121
plt.scatter(
22-
x: x
23-
y: y2
22+
x: x
23+
y: y2
2424
mode: 'lines'
2525
line: plot.Line{
2626
color: '#0000FF'

examples/plot_line_plot_with_areas/main.v

+4-4
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,17 @@ fn main() {
1010

1111
mut plt := plot.Plot.new()
1212
plt.scatter(
13-
x: x
14-
y: y1
13+
x: x
14+
y: y1
1515
mode: 'lines'
1616
line: plot.Line{
1717
color: '#FF0000'
1818
}
1919
name: 'sin(x)'
2020
)
2121
plt.scatter(
22-
x: x
23-
y: y2
22+
x: x
23+
y: y2
2424
mode: 'lines'
2525
line: plot.Line{
2626
color: '#0000FF'

examples/plot_pie/main.v

+4-4
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ fn main() {
88
plt.pie(
99
labels: ['Nitrogen', 'Oxygen', 'Argon', 'Other']
1010
values: [78.0, 21, 0.9, 0.1]
11-
pull: [0.0, 0.1, 0, 0]
12-
hole: 0.25
11+
pull: [0.0, 0.1, 0, 0]
12+
hole: 0.25
1313
)
1414
plt.layout(
15-
title: 'Gases in the atmosphere'
16-
width: 750
15+
title: 'Gases in the atmosphere'
16+
width: 750
1717
height: 750
1818
)
1919
plt.show()!

examples/plot_ripple_surface/main.v

+3-3
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ fn main() {
2020

2121
mut plt := plot.Plot.new()
2222
plt.surface(
23-
x: x
24-
y: y
25-
z: z
23+
x: x
24+
y: y
25+
z: z
2626
colorscale: 'Viridis'
2727
)
2828
plt.layout(

examples/plot_saddle_surface/main.v

+3-3
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ fn main() {
1919

2020
mut plt := plot.Plot.new()
2121
plt.surface(
22-
x: x
23-
y: y
24-
z: z
22+
x: x
23+
y: y
24+
z: z
2525
colorscale: 'Viridis'
2626
)
2727
plt.layout(

examples/plot_scatter/main.v

+4-4
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ fn main() {
2323

2424
mut plt := plot.Plot.new()
2525
plt.scatter(
26-
x: x
27-
y: y
28-
mode: 'lines+markers'
26+
x: x
27+
y: y
28+
mode: 'lines+markers'
2929
marker: plot.Marker{
30-
size: []f64{len: x.len, init: 10.0}
30+
size: []f64{len: x.len, init: 10.0}
3131
color: []string{len: x.len, init: '#FF0000'}
3232
}
3333
line: plot.Line{

examples/plot_scatter3d_1/main.v

+5-5
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@ fn main() {
2424

2525
mut plt := plot.Plot.new()
2626
plt.scatter3d(
27-
x: x
28-
y: y
29-
z: z
30-
mode: 'lines+markers'
27+
x: x
28+
y: y
29+
z: z
30+
mode: 'lines+markers'
3131
marker: plot.Marker{
32-
size: []f64{len: x.len, init: 10.0}
32+
size: []f64{len: x.len, init: 10.0}
3333
color: []string{len: x.len, init: '#0000FF'}
3434
}
3535
line: plot.Line{

examples/plot_scatter3d_2/main.v

+5-5
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ fn main() {
1717

1818
mut plt := plot.Plot.new()
1919
plt.scatter3d(
20-
x: x
21-
y: y
22-
z: z
23-
mode: 'markers'
20+
x: x
21+
y: y
22+
z: z
23+
mode: 'markers'
2424
marker: plot.Marker{
25-
size: []f64{len: x.len, init: 15.0}
25+
size: []f64{len: x.len, init: 15.0}
2626
color: []string{len: x.len, init: '#0000FF'}
2727
}
2828
)

examples/plot_scatter3d_easing/main.v

+7-7
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@ fn main() {
1717
// Create the Scatter3D plot
1818
mut plt := plot.Plot.new()
1919
plt.scatter3d(
20-
name: 'Easing Scatter3D'
21-
x: x_values
22-
y: y_values
23-
z: [][]f64{len: z_values.len, init: z_values}
24-
mode: 'markers'
20+
name: 'Easing Scatter3D'
21+
x: x_values
22+
y: y_values
23+
z: [][]f64{len: z_values.len, init: z_values}
24+
mode: 'markers'
2525
marker: plot.Marker{
26-
size: []f64{len: x_values.len, init: 10.0}
27-
color: time // Color based on time
26+
size: []f64{len: x_values.len, init: 10.0}
27+
color: time // Color based on time
2828
colorscale: 'viridis'
2929
}
3030
)

examples/plot_scatter_colorscale/main.v

+4-4
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ fn main() {
2323

2424
mut plt := plot.Plot.new()
2525
plt.scatter(
26-
x: x
27-
y: y
28-
mode: 'lines+markers'
26+
x: x
27+
y: y
28+
mode: 'lines+markers'
2929
colorscale: 'smoker'
30-
marker: plot.Marker{
30+
marker: plot.Marker{
3131
size: []f64{len: x.len, init: 10.0}
3232
}
3333
)

examples/plot_scatter_easing/main.v

+7-7
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@ fn main() {
1616
// Create the Scatter plot
1717
mut plt := plot.Plot.new()
1818
plt.scatter(
19-
name: 'Easing Scatter'
20-
x: x_values
21-
y: y_values
22-
mode: 'markers'
19+
name: 'Easing Scatter'
20+
x: x_values
21+
y: y_values
22+
mode: 'markers'
2323
colorscale: 'viridis'
24-
marker: plot.Marker{
25-
size: []f64{len: x_values.len, init: 10.0}
26-
color: time // Color based on time
24+
marker: plot.Marker{
25+
size: []f64{len: x_values.len, init: 10.0}
26+
color: time // Color based on time
2727
colorscale: 'viridis'
2828
}
2929
)

examples/plot_scatter_with_annotations/main.v

+5-5
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,19 @@ fn main() {
2222
x := util.arange(y.len)
2323
mut plt := plot.Plot.new()
2424
plt.scatter(
25-
x: x
26-
y: y
27-
mode: 'lines+markers'
25+
x: x
26+
y: y
27+
mode: 'lines+markers'
2828
marker: plot.Marker{
29-
size: []f64{len: x.len, init: 10.0}
29+
size: []f64{len: x.len, init: 10.0}
3030
color: []string{len: x.len, init: '#FF0000'}
3131
}
3232
line: plot.Line{
3333
color: '#FF0000'
3434
}
3535
)
3636
plt.layout(
37-
title: 'Scatter plot example'
37+
title: 'Scatter plot example'
3838
annotations: [plot.Annotation{
3939
text: 'test annotation'
4040
}]

0 commit comments

Comments
 (0)