File tree Expand file tree Collapse file tree 2 files changed +8
-5
lines changed
examples/solidHeatTransferScript/exampleSolidHeatTransfer01 Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Original file line number Diff line number Diff line change 5757 <!-- Webpage text -->
5858 < body >
5959 < h1 > Heat Conduction in a Two-Dimensional Fin</ h1 >
60- < div id ="plot "> </ div >
60+ < div id ="solutionPlot "> </ div >
6161
6262 < p >
6363 The mesh configuration and boundary conditions can be adjusted by editing
@@ -146,7 +146,8 @@ <h1>Heat Conduction in a Two-Dimensional Fin</h1>
146146 nodesCoordinates ,
147147 solverConfig ,
148148 meshConfig . meshDimension ,
149- "contour"
149+ "contour" ,
150+ "solutionPlot"
150151 ) ;
151152 } ) ;
152153 </ script >
Original file line number Diff line number Diff line change 1515 * @param {string } solverConfig - Parameter specifying the type of solver
1616 * @param {string } meshDimension - The dimension of the solution
1717 * @param {string } plotType - The type of plot
18+ * @param {string } plotDivId - The id of the div where the plot will be rendered
1819 */
1920export function plotSolution (
2021 solutionVector ,
2122 nodesCoordinates ,
2223 solverConfig ,
2324 meshDimension ,
24- plotType
25+ plotType ,
26+ plotDivId
2527) {
2628 const { nodesXCoordinates, nodesYCoordinates } = nodesCoordinates ;
2729
2830 // Check if the device is in vertical position
2931 if ( window . innerHeight > window . innerWidth ) {
30- document . getElementById ( "plot" ) . innerHTML =
32+ document . getElementById ( plotDivId ) . innerHTML =
3133 "Cannot draw the results. Please turn your phone to horizontal position to see the results." ;
3234 return ;
3335 }
@@ -94,6 +96,6 @@ export function plotSolution(
9496 } ;
9597
9698 // Create the contour plot using Plotly
97- Plotly . newPlot ( "plot" , data , layout ) ;
99+ Plotly . newPlot ( plotDivId , data , layout ) ;
98100 }
99101}
You can’t perform that action at this time.
0 commit comments