Skip to content

Commit

Permalink
Add settings for crosshair and the ability to highlight chart on the …
Browse files Browse the repository at this point in the history
…panel (#30)
  • Loading branch information
eliza-eliza authored Nov 15, 2024
1 parent f83cf23 commit 51c6ae0
Show file tree
Hide file tree
Showing 15 changed files with 463 additions and 95 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "LightweightCharts"
uuid = "d6998af1-87ca-4e7f-83d4-864c79a249fa"
version = "2.2.3"
version = "2.3.0"

[deps]
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
Expand Down
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ panel = lwc_panel(
precision = 4,
);
name = "LightweightCharts ❤️ TimeArrays",
default_legend_visible = false,
)

lwc_show(panel)
Expand Down Expand Up @@ -132,6 +133,9 @@ layout = lwc_layout(
line_width = 3,
price_scale_id = LWC_RIGHT,
);
last_value_visible = true,
title_visible = true,
default_legend_visible = false,
x = 1,
y = 1,
),
Expand Down Expand Up @@ -188,6 +192,21 @@ chart = lwc_panel(
point_markers_visible = true,
line_visible = false,
);
crosshair_settings = CrosshairOptions(;
mode = LWC_CROSSHAIR_NORMAL,
vert_line = CrosshairLineOptions(;
style = LWC_CROSSHAIR_SOLID,
color = "#C3BCDB44",
label_background_color = "#9B7DFF",
width = 8,
),
horz_line = CrosshairLineOptions(;
color = "#9B7DFF",
label_background_color = "#9B7DFF",
)
),
last_value_visible = true,
title_visible = true,
max_y = 1.6
)

Expand Down
Binary file modified docs/src/assets/chart.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/src/assets/layout.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/src/assets/smoothed_prices.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions docs/src/pages/layout.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,19 @@ panel = lwc_panel(
price_scale_id = LWC_RIGHT,
);
name = "Panel example",
crosshair_settings = CrosshairOptions(;
mode = LWC_CROSSHAIR_NORMAL,
vert_line = CrosshairLineOptions(;
style = LWC_CROSSHAIR_SOLID,
color = "#C3BCDB44",
label_background_color = "#9B7DFF",
width = 8,
),
horz_line = CrosshairLineOptions(;
color = "#9B7DFF",
label_background_color = "#9B7DFF",
)
),
)
lwc_save("panel_example.html", panel)
Expand Down Expand Up @@ -77,6 +90,8 @@ layout = lwc_layout(
price_scale_id = LWC_RIGHT,
);
tooltip = false,
last_value_visible = true,
title_visible = true,
x = 1,
y = 1,
),
Expand Down Expand Up @@ -105,6 +120,7 @@ layout = lwc_layout(
price_scale_id = LWC_RIGHT,
);
tooltip_format = "\${label_name}: \${value}",
default_legend_visible = true,
x = 1,
y = 2,
);
Expand Down
2 changes: 1 addition & 1 deletion frontend/dist/index_boundle.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"@testing-library/jest-dom": "^5.17.0",
"@testing-library/react": "^13.4.0",
"@testing-library/user-event": "^13.5.0",
"color": "^4.2.3",
"lightweight-charts": "^4.1.4",
"react": "^18.2.0",
"react-dom": "^18.2.0",
Expand Down
7 changes: 4 additions & 3 deletions frontend/src/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,13 @@ body {
max-width: 20px;
min-height: 16px;
min-width: 20px;
position: sticky
position: sticky;
background-color: #f8f8ff;
border-color: #d1d4dc
}

.tabs .btn:hover {
background-color: #f8f8ff;
border-color: #d1d4dc
background-color: #e0e3eb;
}

.tabs .searchs {
Expand Down
Loading

2 comments on commit 51c6ae0

@gryumov
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator register()

Release notes:

  • Add settings for crosshair and the ability to highlight chart on the panel

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/119503

Tagging

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v2.3.0 -m "<description of version>" 51c6ae0e8fc2b5c45dc66ed7e1042d2fe4d86f07
git push origin v2.3.0

Please sign in to comment.