@@ -122,19 +122,6 @@ struct WrappedDeviceCallbacks {
122122#[ derive( Debug , Clone , Hash , PartialEq , Eq ) ]
123123struct PlotId ( String ) ;
124124
125- /// Metadata captured at plot creation time
126- #[ derive( Debug , Clone ) ]
127- struct PlotMetadataInfo {
128- /// Human-readable name (e.g., "ggplot2 scatter plot 1")
129- name : String ,
130- /// Kind of plot (e.g., "ggplot2 scatter plot", "histogram")
131- kind : String ,
132- /// The Jupyter message ID of the execute_request that produced the plot
133- execution_id : String ,
134- /// Code that produced the plot
135- code : String ,
136- }
137-
138125struct DeviceContext {
139126 /// Channel for sending [CommManagerEvent]s to Positron when plot events occur
140127 comm_manager_tx : Sender < CommManagerEvent > ,
@@ -186,7 +173,7 @@ struct DeviceContext {
186173 sockets : RefCell < HashMap < PlotId , CommSocket > > ,
187174
188175 /// Mapping of plot ID to its metadata (captured at creation time)
189- metadata : RefCell < HashMap < PlotId , PlotMetadataInfo > > ,
176+ metadata : RefCell < HashMap < PlotId , PlotMetadata > > ,
190177
191178 /// Counters for generating unique plot names by kind
192179 kind_counters : RefCell < HashMap < String , u32 > > ,
@@ -634,14 +621,12 @@ impl DeviceContext {
634621 let kind = self . detect_plot_kind ( id) ;
635622 let name = self . generate_plot_name ( & kind) ;
636623
637- self . metadata
638- . borrow_mut ( )
639- . insert ( id. clone ( ) , PlotMetadataInfo {
640- name,
641- kind,
642- execution_id,
643- code,
644- } ) ;
624+ self . metadata . borrow_mut ( ) . insert ( id. clone ( ) , PlotMetadata {
625+ name,
626+ kind,
627+ execution_id,
628+ code,
629+ } ) ;
645630
646631 // Let Positron know that we just created a new plot.
647632 let socket = CommSocket :: new (
@@ -689,14 +674,12 @@ impl DeviceContext {
689674 let kind = self . detect_plot_kind ( id) ;
690675 let name = self . generate_plot_name ( & kind) ;
691676
692- self . metadata
693- . borrow_mut ( )
694- . insert ( id. clone ( ) , PlotMetadataInfo {
695- name,
696- kind,
697- execution_id,
698- code,
699- } ) ;
677+ self . metadata . borrow_mut ( ) . insert ( id. clone ( ) , PlotMetadata {
678+ name,
679+ kind,
680+ execution_id,
681+ code,
682+ } ) ;
700683
701684 let data = unwrap ! ( self . create_display_data_plot( id) , Err ( error) => {
702685 log:: error!( "Failed to create plot due to: {error}." ) ;
0 commit comments