Skip to main content

Module symbol_search

Module symbol_search 

Source
Expand description

Instrument search and comparison dialogs

Provides symbol search with keyboard navigation and multi-symbol comparison functionality.

use egui_charts::model::Instrument;
use egui_charts::ui::top_toolbar::SymbolSearchDialog;

let mut dialog = SymbolSearchDialog::new();
let symbols = vec![
    Instrument::new("BTCUSDT").with_description("Bitcoin / Tether"),
    Instrument::new("ETHUSDT").with_description("Ethereum / Tether"),
];

// In your egui update loop
if let Some(selected) = dialog.show(ctx, &symbols) {
    println!("Selected: {}", selected.symbol);
}

§Example - Compare Symbols

use egui_charts::model::Instrument;
use egui_charts::ui::top_toolbar::{CompareAction, CompareSymbolsDialog};

let mut compare = CompareSymbolsDialog::new();
compare.open();

// The symbols your data source offers
let symbols = vec![Instrument::new("ETHUSDT").with_description("Ethereum / Tether")];
match compare.show(ctx, &symbols) {
    CompareAction::AddSymbol(sym, placement) => println!("Add: {sym} ({placement:?})"),
    CompareAction::RemoveSymbol(sym) => println!("Remove: {}", sym),
    _ => {}
}

Structs§

CompareSymbol
Instrument information for comparison
CompareSymbolsConfig
Configuration for compare symbols dialog
CompareSymbolsDialog
Compare symbols dialog
SymbolSearchConfig
Configuration for symbol search dialog
SymbolSearchDialog
Instrument search dialog with keyboard navigation

Enums§

CompareAction
Action from compare symbols dialog
ComparePlacement
Where a symbol added from the compare dialog goes.