[{"data":1,"prerenderedAt":1456},["ShallowReactive",2],{"lib:\u002Fplot\u002Fgetting-started":3,"lib-nav:en:\u002Fplot":1433},{"id":4,"title":5,"body":6,"description":1424,"extension":1425,"group":1426,"meta":1427,"navigation":150,"order":86,"path":1429,"seo":1430,"stem":1431,"__hash__":1432},"libs\u002Fplot\u002Fgetting-started.md","Getting started",{"type":7,"value":8,"toc":1415},"minimark",[9,13,30,53,68,73,104,111,115,122,483,494,672,769,779,797,801,808,1034,1041,1067,1071,1084,1204,1219,1223,1233,1279,1285,1289,1292,1363,1376,1380,1411],[10,11,5],"h1",{"id":12},"getting-started",[14,15,16,17,22,23,29],"p",{},"@edubeam\u002Fplot draws a plane beam, frame or truss and its results as SVG: members, supports, loads, reactions, the N, V and M diagrams and the deformed shape, just as the figures on this site look. You give it a model solved by ",[18,19,21],"a",{"href":20},"\u002Fsolver","@edubeam\u002Ffem",", the solver behind ",[24,25,28],"span",{"className":26},[27],"edubeam","EduBeam","; it works out the layout, the scale and where every number goes.",[14,31,32,33,37,38,42,43,47,48,52],{},"Teachers use it for ",[18,34,36],{"href":35},"\u002Fplot\u002Fexercises","exercises and tests"," generated from a seed, ",[18,39,41],{"href":40},"\u002Fplot\u002Fslides","slides that build up"," click by click, and figures for notes, in a web page or as files for LaTeX and Word. This site's ",[18,44,46],{"href":45},"\u002Fpractice","practice problems"," and ",[18,49,51],{"href":50},"\u002Fexam","exam builder"," are made with it.",[54,55,58],"div",{"className":56},[57],"actions",[14,59,60,64,65],{},[18,61,63],{"href":62},"#draw-a-solved-model","Draw your first plot"," ",[18,66,67],{"href":35},"Generate exercises",[69,70,72],"h2",{"id":71},"install","Install",[74,75,80],"pre",{"className":76,"code":77,"language":78,"meta":79,"style":79},"language-bash shiki shiki-themes github-light github-dark","npm install @edubeam\u002Fplot @edubeam\u002Ffem vue\n","bash","",[81,82,83],"code",{"__ignoreMap":79},[24,84,87,91,95,98,101],{"class":85,"line":86},"line",1,[24,88,90],{"class":89},"sScJk","npm",[24,92,94],{"class":93},"sZZnC"," install",[24,96,97],{"class":93}," @edubeam\u002Fplot",[24,99,100],{"class":93}," @edubeam\u002Ffem",[24,102,103],{"class":93}," vue\n",[14,105,106,107,110],{},"Vue 3.5 or later and the solver are peer dependencies, so your app keeps one copy of each. The package is ESM only, ships its own types and needs no stylesheet. It runs in Node 20.19 or later; to run a script written in TypeScript as it is, with ",[81,108,109],{},"node script.ts",", Node 22.18 or later.",[69,112,114],{"id":113},"draw-a-solved-model","Draw a solved model",[14,116,117,118,121],{},"Two files. The first, ",[81,119,120],{},"beams.ts",", builds and solves a beam with @edubeam\u002Ffem. It is a plain function, so the same model can feed a page, a slide and a script:",[74,123,127],{"className":124,"code":125,"filename":120,"language":126,"meta":79,"style":79},"language-ts shiki shiki-themes github-light github-dark","import { DofID, LinearStaticSolver } from '@edubeam\u002Ffem'\n\n\u002F** A simply supported beam, `span` m long, under `q` kN\u002Fm: solved. The solver works in SI units. *\u002F\nexport const simpleBeam = (span: number, q: number): LinearStaticSolver => {\n  const solver = new LinearStaticSolver()\n  const { domain } = solver\n  domain.createMaterial(1, { e: 210e9, g: 81e9 }) \u002F\u002F steel, Pa\n  domain.createCrossSection(1, { a: 28.5e-4, iy: 1943e-8, h: 0.2, k: 1e32 }) \u002F\u002F IPE 200, rigid in shear\n  domain.createNode('A', [0, 0, 0], [DofID.Dx, DofID.Dz]) \u002F\u002F pin\n  domain.createNode('B', [span, 0, 0], [DofID.Dz]) \u002F\u002F roller\n  domain.createBeam2D(1, ['A', 'B'], 1, 1)\n  solver.loadCases[0].createBeamElementUniformEdgeLoad(1, [0, q * 1e3], true) \u002F\u002F N\u002Fm, +z is down\n  solver.solve()\n  return solver\n}\n","ts",[81,128,129,145,152,159,211,230,250,283,324,357,384,416,458,469,477],{"__ignoreMap":79},[24,130,131,135,139,142],{"class":85,"line":86},[24,132,134],{"class":133},"szBVR","import",[24,136,138],{"class":137},"sVt8B"," { DofID, LinearStaticSolver } ",[24,140,141],{"class":133},"from",[24,143,144],{"class":93}," '@edubeam\u002Ffem'\n",[24,146,148],{"class":85,"line":147},2,[24,149,151],{"emptyLinePlaceholder":150},true,"\n",[24,153,155],{"class":85,"line":154},3,[24,156,158],{"class":157},"sJ8bj","\u002F** A simply supported beam, `span` m long, under `q` kN\u002Fm: solved. The solver works in SI units. *\u002F\n",[24,160,162,165,168,171,174,177,180,183,187,190,193,195,197,200,202,205,208],{"class":85,"line":161},4,[24,163,164],{"class":133},"export",[24,166,167],{"class":133}," const",[24,169,170],{"class":89}," simpleBeam",[24,172,173],{"class":133}," =",[24,175,176],{"class":137}," (",[24,178,24],{"class":179},"s4XuR",[24,181,182],{"class":133},":",[24,184,186],{"class":185},"sj4cs"," number",[24,188,189],{"class":137},", ",[24,191,192],{"class":179},"q",[24,194,182],{"class":133},[24,196,186],{"class":185},[24,198,199],{"class":137},")",[24,201,182],{"class":133},[24,203,204],{"class":89}," LinearStaticSolver",[24,206,207],{"class":133}," =>",[24,209,210],{"class":137}," {\n",[24,212,214,217,220,222,225,227],{"class":85,"line":213},5,[24,215,216],{"class":133},"  const",[24,218,219],{"class":185}," solver",[24,221,173],{"class":133},[24,223,224],{"class":133}," new",[24,226,204],{"class":89},[24,228,229],{"class":137},"()\n",[24,231,233,235,238,241,244,247],{"class":85,"line":232},6,[24,234,216],{"class":133},[24,236,237],{"class":137}," { ",[24,239,240],{"class":185},"domain",[24,242,243],{"class":137}," } ",[24,245,246],{"class":133},"=",[24,248,249],{"class":137}," solver\n",[24,251,253,256,259,262,265,268,271,274,277,280],{"class":85,"line":252},7,[24,254,255],{"class":137},"  domain.",[24,257,258],{"class":89},"createMaterial",[24,260,261],{"class":137},"(",[24,263,264],{"class":185},"1",[24,266,267],{"class":137},", { e: ",[24,269,270],{"class":185},"210e9",[24,272,273],{"class":137},", g: ",[24,275,276],{"class":185},"81e9",[24,278,279],{"class":137}," }) ",[24,281,282],{"class":157},"\u002F\u002F steel, Pa\n",[24,284,286,288,291,293,295,298,301,304,307,310,313,316,319,321],{"class":85,"line":285},8,[24,287,255],{"class":137},[24,289,290],{"class":89},"createCrossSection",[24,292,261],{"class":137},[24,294,264],{"class":185},[24,296,297],{"class":137},", { a: ",[24,299,300],{"class":185},"28.5e-4",[24,302,303],{"class":137},", iy: ",[24,305,306],{"class":185},"1943e-8",[24,308,309],{"class":137},", h: ",[24,311,312],{"class":185},"0.2",[24,314,315],{"class":137},", k: ",[24,317,318],{"class":185},"1e32",[24,320,279],{"class":137},[24,322,323],{"class":157},"\u002F\u002F IPE 200, rigid in shear\n",[24,325,327,329,332,334,337,340,343,345,347,349,351,354],{"class":85,"line":326},9,[24,328,255],{"class":137},[24,330,331],{"class":89},"createNode",[24,333,261],{"class":137},[24,335,336],{"class":93},"'A'",[24,338,339],{"class":137},", [",[24,341,342],{"class":185},"0",[24,344,189],{"class":137},[24,346,342],{"class":185},[24,348,189],{"class":137},[24,350,342],{"class":185},[24,352,353],{"class":137},"], [DofID.Dx, DofID.Dz]) ",[24,355,356],{"class":157},"\u002F\u002F pin\n",[24,358,360,362,364,366,369,372,374,376,378,381],{"class":85,"line":359},10,[24,361,255],{"class":137},[24,363,331],{"class":89},[24,365,261],{"class":137},[24,367,368],{"class":93},"'B'",[24,370,371],{"class":137},", [span, ",[24,373,342],{"class":185},[24,375,189],{"class":137},[24,377,342],{"class":185},[24,379,380],{"class":137},"], [DofID.Dz]) ",[24,382,383],{"class":157},"\u002F\u002F roller\n",[24,385,387,389,392,394,396,398,400,402,404,407,409,411,413],{"class":85,"line":386},11,[24,388,255],{"class":137},[24,390,391],{"class":89},"createBeam2D",[24,393,261],{"class":137},[24,395,264],{"class":185},[24,397,339],{"class":137},[24,399,336],{"class":93},[24,401,189],{"class":137},[24,403,368],{"class":93},[24,405,406],{"class":137},"], ",[24,408,264],{"class":185},[24,410,189],{"class":137},[24,412,264],{"class":185},[24,414,415],{"class":137},")\n",[24,417,419,422,424,427,430,432,434,436,438,441,444,447,449,452,455],{"class":85,"line":418},12,[24,420,421],{"class":137},"  solver.loadCases[",[24,423,342],{"class":185},[24,425,426],{"class":137},"].",[24,428,429],{"class":89},"createBeamElementUniformEdgeLoad",[24,431,261],{"class":137},[24,433,264],{"class":185},[24,435,339],{"class":137},[24,437,342],{"class":185},[24,439,440],{"class":137},", q ",[24,442,443],{"class":133},"*",[24,445,446],{"class":185}," 1e3",[24,448,406],{"class":137},[24,450,451],{"class":185},"true",[24,453,454],{"class":137},") ",[24,456,457],{"class":157},"\u002F\u002F N\u002Fm, +z is down\n",[24,459,461,464,467],{"class":85,"line":460},13,[24,462,463],{"class":137},"  solver.",[24,465,466],{"class":89},"solve",[24,468,229],{"class":137},[24,470,472,475],{"class":85,"line":471},14,[24,473,474],{"class":133},"  return",[24,476,249],{"class":137},[24,478,480],{"class":85,"line":479},15,[24,481,482],{"class":137},"}\n",[14,484,485,486,489,490,493],{},"The second, ",[81,487,488],{},"BeamFigure.vue",", hands the solver to ",[81,491,492],{},"StructurePlot"," and says what to draw:",[74,495,499],{"className":496,"code":497,"filename":488,"language":498,"meta":79,"style":79},"language-vue shiki shiki-themes github-light github-dark","\u003Cscript setup lang=\"ts\">\nimport { StructurePlot } from '@edubeam\u002Fplot'\nimport { simpleBeam } from '.\u002Fbeams'\n\nconst beam = simpleBeam(6, 12)\n\u003C\u002Fscript>\n\n\u003Ctemplate>\n  \u003CStructurePlot :solver=\"beam\" :layers=\"['members', 'supports', 'loads', 'reactions', 'M']\" \u002F>\n\u003C\u002Ftemplate>\n","vue",[81,500,501,524,536,548,552,576,585,589,598,664],{"__ignoreMap":79},[24,502,503,506,510,513,516,518,521],{"class":85,"line":86},[24,504,505],{"class":137},"\u003C",[24,507,509],{"class":508},"s9eBZ","script",[24,511,512],{"class":89}," setup",[24,514,515],{"class":89}," lang",[24,517,246],{"class":137},[24,519,520],{"class":93},"\"ts\"",[24,522,523],{"class":137},">\n",[24,525,526,528,531,533],{"class":85,"line":147},[24,527,134],{"class":133},[24,529,530],{"class":137}," { StructurePlot } ",[24,532,141],{"class":133},[24,534,535],{"class":93}," '@edubeam\u002Fplot'\n",[24,537,538,540,543,545],{"class":85,"line":154},[24,539,134],{"class":133},[24,541,542],{"class":137}," { simpleBeam } ",[24,544,141],{"class":133},[24,546,547],{"class":93}," '.\u002Fbeams'\n",[24,549,550],{"class":85,"line":161},[24,551,151],{"emptyLinePlaceholder":150},[24,553,554,557,560,562,564,566,569,571,574],{"class":85,"line":213},[24,555,556],{"class":133},"const",[24,558,559],{"class":185}," beam",[24,561,173],{"class":133},[24,563,170],{"class":89},[24,565,261],{"class":137},[24,567,568],{"class":185},"6",[24,570,189],{"class":137},[24,572,573],{"class":185},"12",[24,575,415],{"class":137},[24,577,578,581,583],{"class":85,"line":232},[24,579,580],{"class":137},"\u003C\u002F",[24,582,509],{"class":508},[24,584,523],{"class":137},[24,586,587],{"class":85,"line":252},[24,588,151],{"emptyLinePlaceholder":150},[24,590,591,593,596],{"class":85,"line":285},[24,592,505],{"class":137},[24,594,595],{"class":508},"template",[24,597,523],{"class":137},[24,599,600,603,605,608,611,613,616,619,621,623,626,628,630,633,636,638,641,643,646,648,651,653,656,659,661],{"class":85,"line":326},[24,601,602],{"class":137},"  \u003C",[24,604,492],{"class":508},[24,606,607],{"class":137}," :",[24,609,610],{"class":89},"solver",[24,612,246],{"class":137},[24,614,615],{"class":93},"\"",[24,617,618],{"class":137},"beam",[24,620,615],{"class":93},[24,622,607],{"class":137},[24,624,625],{"class":89},"layers",[24,627,246],{"class":137},[24,629,615],{"class":93},[24,631,632],{"class":137},"[",[24,634,635],{"class":93},"'members'",[24,637,189],{"class":137},[24,639,640],{"class":93},"'supports'",[24,642,189],{"class":137},[24,644,645],{"class":93},"'loads'",[24,647,189],{"class":137},[24,649,650],{"class":93},"'reactions'",[24,652,189],{"class":137},[24,654,655],{"class":93},"'M'",[24,657,658],{"class":137},"]",[24,660,615],{"class":93},[24,662,663],{"class":137}," \u002F>\n",[24,665,666,668,670],{"class":85,"line":359},[24,667,580],{"class":137},[24,669,595],{"class":508},[24,671,523],{"class":137},[14,673,674,675,768],{},"That is the whole figure: the beam on its supports, the 12 kN\u002Fm load, the two 36 kN reactions, and the bending moment, ",[24,676,679],{"className":677},[678],"katex",[24,680,683,757],{"className":681,"ariaHidden":451},[682],"katex-html",[24,684,687,692,698,741,745,750,754],{"className":685},[686],"katex-base",[24,688],{"className":689,"style":691},[690],"katex-strut","height:1.0641em;vertical-align:-0.25em;",[24,693,192],{"className":694,"style":697},[695,696],"mord","mathnormal","margin-right:0.0359em;",[24,699,701,705],{"className":700},[695],[24,702,704],{"className":703},[695,696],"L",[24,706,709],{"className":707},[708],"msupsub",[24,710,713],{"className":711},[712],"vlist-t",[24,714,717],{"className":715},[716],"vlist-r",[24,718,722],{"className":719,"style":721},[720],"vlist","height:0.8141em;",[24,723,725,730],{"style":724},"top:-3.063em;margin-right:0.05em;",[24,726],{"className":727,"style":729},[728],"pstrut","height:2.7em;",[24,731,737],{"className":732},[733,734,735,736],"katex-sizing","reset-size6","size3","mtight",[24,738,740],{"className":739},[695,736],"2",[24,742,744],{"className":743},[695],"\u002F8",[24,746],{"className":747,"style":749},[748],"mspace","margin-right:0.2778em;",[24,751,246],{"className":752},[753],"mrel",[24,755],{"className":756,"style":749},[748],[24,758,760,764],{"className":759},[686],[24,761],{"className":762,"style":763},[690],"height:0.6444em;",[24,765,767],{"className":766},[695],"54"," kNm at midspan, hanging on the tension side:",[770,771],"model-figure",{":loads":772,":members":773,":nodes":774,":results":775,":supports":776,"caption":777,"labels":778},"[{\"member\":1,\"qz\":12}]","[[\"A\",\"B\"]]","{\"A\":[0,0],\"B\":[6,0]}","[\"M\"]","{\"A\":\"pin\",\"B\":\"roller\"}","What BeamFigure.vue draws: a 6 m span under 12 kN\u002Fm","horizontal",[14,780,781,782,784,785,788,789,791,792,796],{},"The plot fills the width of its container and sets its own height. Text, symbols and line weights keep their size in pixels whatever the size of the structure, so a figure stays legible on a phone. Leave ",[81,783,625],{}," out and the plot picks the result itself: M for beams and frames, N for a truss. All the ",[18,786,625],{"href":787},"\u002Fplot\u002Fstructure-plot#layers"," are listed with ",[81,790,492],{},"; building models is covered in the ",[18,793,795],{"href":794},"\u002Fsolver\u002Fgetting-started","solver docs",".",[69,798,800],{"id":799},"when-the-model-changes","When the model changes",[14,802,803,804,807],{},"A plot reads the solver it is given; it does not watch it. When something changes, solve again and pass the new solver. A ",[81,805,806],{},"computed"," does exactly that:",[74,809,812],{"className":496,"code":810,"filename":811,"language":498,"meta":79,"style":79},"\u003Cscript setup lang=\"ts\">\nimport { computed, ref } from 'vue'\nimport { StructurePlot } from '@edubeam\u002Fplot'\nimport { simpleBeam } from '.\u002Fbeams'\n\nconst q = ref(12) \u002F\u002F kN\u002Fm\nconst beam = computed(() => simpleBeam(6, q.value))\n\u003C\u002Fscript>\n\n\u003Ctemplate>\n  \u003Cinput v-model.number=\"q\" type=\"range\" min=\"1\" max=\"30\" \u002F>\n  \u003CStructurePlot :solver=\"beam\" :layers=\"['members', 'supports', 'loads', 'reactions', 'M']\" \u002F>\n\u003C\u002Ftemplate>\n","LoadSlider.vue",[81,813,814,830,842,852,862,866,887,913,921,925,933,974,1026],{"__ignoreMap":79},[24,815,816,818,820,822,824,826,828],{"class":85,"line":86},[24,817,505],{"class":137},[24,819,509],{"class":508},[24,821,512],{"class":89},[24,823,515],{"class":89},[24,825,246],{"class":137},[24,827,520],{"class":93},[24,829,523],{"class":137},[24,831,832,834,837,839],{"class":85,"line":147},[24,833,134],{"class":133},[24,835,836],{"class":137}," { computed, ref } ",[24,838,141],{"class":133},[24,840,841],{"class":93}," 'vue'\n",[24,843,844,846,848,850],{"class":85,"line":154},[24,845,134],{"class":133},[24,847,530],{"class":137},[24,849,141],{"class":133},[24,851,535],{"class":93},[24,853,854,856,858,860],{"class":85,"line":161},[24,855,134],{"class":133},[24,857,542],{"class":137},[24,859,141],{"class":133},[24,861,547],{"class":93},[24,863,864],{"class":85,"line":213},[24,865,151],{"emptyLinePlaceholder":150},[24,867,868,870,873,875,878,880,882,884],{"class":85,"line":232},[24,869,556],{"class":133},[24,871,872],{"class":185}," q",[24,874,173],{"class":133},[24,876,877],{"class":89}," ref",[24,879,261],{"class":137},[24,881,573],{"class":185},[24,883,454],{"class":137},[24,885,886],{"class":157},"\u002F\u002F kN\u002Fm\n",[24,888,889,891,893,895,898,901,904,906,908,910],{"class":85,"line":252},[24,890,556],{"class":133},[24,892,559],{"class":185},[24,894,173],{"class":133},[24,896,897],{"class":89}," computed",[24,899,900],{"class":137},"(() ",[24,902,903],{"class":133},"=>",[24,905,170],{"class":89},[24,907,261],{"class":137},[24,909,568],{"class":185},[24,911,912],{"class":137},", q.value))\n",[24,914,915,917,919],{"class":85,"line":285},[24,916,580],{"class":137},[24,918,509],{"class":508},[24,920,523],{"class":137},[24,922,923],{"class":85,"line":326},[24,924,151],{"emptyLinePlaceholder":150},[24,926,927,929,931],{"class":85,"line":359},[24,928,505],{"class":137},[24,930,595],{"class":508},[24,932,523],{"class":137},[24,934,935,937,940,943,945,948,951,953,956,959,961,964,967,969,972],{"class":85,"line":386},[24,936,602],{"class":137},[24,938,939],{"class":508},"input",[24,941,942],{"class":89}," v-model.number",[24,944,246],{"class":137},[24,946,947],{"class":93},"\"q\"",[24,949,950],{"class":89}," type",[24,952,246],{"class":137},[24,954,955],{"class":93},"\"range\"",[24,957,958],{"class":89}," min",[24,960,246],{"class":137},[24,962,963],{"class":93},"\"1\"",[24,965,966],{"class":89}," max",[24,968,246],{"class":137},[24,970,971],{"class":93},"\"30\"",[24,973,663],{"class":137},[24,975,976,978,980,982,984,986,988,990,992,994,996,998,1000,1002,1004,1006,1008,1010,1012,1014,1016,1018,1020,1022,1024],{"class":85,"line":418},[24,977,602],{"class":137},[24,979,492],{"class":508},[24,981,607],{"class":137},[24,983,610],{"class":89},[24,985,246],{"class":137},[24,987,615],{"class":93},[24,989,618],{"class":137},[24,991,615],{"class":93},[24,993,607],{"class":137},[24,995,625],{"class":89},[24,997,246],{"class":137},[24,999,615],{"class":93},[24,1001,632],{"class":137},[24,1003,635],{"class":93},[24,1005,189],{"class":137},[24,1007,640],{"class":93},[24,1009,189],{"class":137},[24,1011,645],{"class":93},[24,1013,189],{"class":137},[24,1015,650],{"class":93},[24,1017,189],{"class":137},[24,1019,655],{"class":93},[24,1021,658],{"class":137},[24,1023,615],{"class":93},[24,1025,663],{"class":137},[24,1027,1028,1030,1032],{"class":85,"line":460},[24,1029,580],{"class":137},[24,1031,595],{"class":508},[24,1033,523],{"class":137},[14,1035,1036,1037,1040],{},"A beam like this solves in about a millisecond, so the figure follows the slider as it moves. Changed a solver in place instead? Bump the ",[81,1038,1039],{},"revision"," prop and the plot reads it again.",[1042,1043,1046],"callout",{"title":1044,"type":1045},"Keep solvers out of deep reactivity","tip",[14,1047,1048,1049,1051,1052,1054,1055,1058,1059,1062,1063,1066],{},"A ",[81,1050,806],{},", a prop or a plain ",[81,1053,556],{}," holds a solver as it is. To keep one in component state, use ",[81,1056,1057],{},"shallowRef"," or wrap it in ",[81,1060,1061],{},"markRaw",": a plain ",[81,1064,1065],{},"ref"," would make Vue walk the whole solver to make it reactive, for nothing.",[69,1068,1070],{"id":1069},"save-it-as-a-file","Save it as a file",[14,1072,1073,1074,1077,1078,1081,1082,182],{},"For a figure in LaTeX, Word or Inkscape, ",[81,1075,1076],{},"structureSvg"," writes the same drawing as a standalone SVG file with plain colours. It needs neither Vue nor a browser, only Node. Save this as ",[81,1079,1080],{},"beam-svg.ts"," next to ",[81,1083,120],{},[74,1085,1087],{"className":124,"code":1086,"filename":1080,"language":126,"meta":79,"style":79},"import { writeFileSync } from 'node:fs'\nimport { modelFromSolver, structureSvg } from '@edubeam\u002Fplot'\nimport { simpleBeam } from '.\u002Fbeams.ts'\n\nconst svg = structureSvg(modelFromSolver(simpleBeam(6, 12)), {\n  layers: ['members', 'supports', 'loads', 'reactions', 'M'],\n})\nwriteFileSync('beam.svg', svg)\n",[81,1088,1089,1101,1112,1123,1127,1160,1186,1191],{"__ignoreMap":79},[24,1090,1091,1093,1096,1098],{"class":85,"line":86},[24,1092,134],{"class":133},[24,1094,1095],{"class":137}," { writeFileSync } ",[24,1097,141],{"class":133},[24,1099,1100],{"class":93}," 'node:fs'\n",[24,1102,1103,1105,1108,1110],{"class":85,"line":147},[24,1104,134],{"class":133},[24,1106,1107],{"class":137}," { modelFromSolver, structureSvg } ",[24,1109,141],{"class":133},[24,1111,535],{"class":93},[24,1113,1114,1116,1118,1120],{"class":85,"line":154},[24,1115,134],{"class":133},[24,1117,542],{"class":137},[24,1119,141],{"class":133},[24,1121,1122],{"class":93}," '.\u002Fbeams.ts'\n",[24,1124,1125],{"class":85,"line":161},[24,1126,151],{"emptyLinePlaceholder":150},[24,1128,1129,1131,1134,1136,1139,1141,1144,1146,1149,1151,1153,1155,1157],{"class":85,"line":213},[24,1130,556],{"class":133},[24,1132,1133],{"class":185}," svg",[24,1135,173],{"class":133},[24,1137,1138],{"class":89}," structureSvg",[24,1140,261],{"class":137},[24,1142,1143],{"class":89},"modelFromSolver",[24,1145,261],{"class":137},[24,1147,1148],{"class":89},"simpleBeam",[24,1150,261],{"class":137},[24,1152,568],{"class":185},[24,1154,189],{"class":137},[24,1156,573],{"class":185},[24,1158,1159],{"class":137},")), {\n",[24,1161,1162,1165,1167,1169,1171,1173,1175,1177,1179,1181,1183],{"class":85,"line":232},[24,1163,1164],{"class":137},"  layers: [",[24,1166,635],{"class":93},[24,1168,189],{"class":137},[24,1170,640],{"class":93},[24,1172,189],{"class":137},[24,1174,645],{"class":93},[24,1176,189],{"class":137},[24,1178,650],{"class":93},[24,1180,189],{"class":137},[24,1182,655],{"class":93},[24,1184,1185],{"class":137},"],\n",[24,1187,1188],{"class":85,"line":252},[24,1189,1190],{"class":137},"})\n",[24,1192,1193,1196,1198,1201],{"class":85,"line":285},[24,1194,1195],{"class":89},"writeFileSync",[24,1197,261],{"class":137},[24,1199,1200],{"class":93},"'beam.svg'",[24,1202,1203],{"class":137},", svg)\n",[14,1205,1206,1207,1210,1211,1214,1215,796],{},"Run it with ",[81,1208,1209],{},"node beam-svg.ts"," (Node 22.18 or later; on older versions, ",[81,1212,1213],{},"npx tsx beam-svg.ts","). The options, and how to bring the file into LaTeX and Word, are in ",[18,1216,1218],{"href":1217},"\u002Fplot\u002Ffunctions#a-standalone-svg-file","A standalone SVG file",[69,1220,1222],{"id":1221},"the-stacked-figure","The stacked figure",[14,1224,1225,1228,1229,1232],{},[81,1226,1227],{},"DiagramStack"," draws the figure of every statics textbook: a straight beam with its loads, and its V(x), M(x) and w(x) beneath it on one x axis. With ",[81,1230,1231],{},"v-model:load-at"," the reader can drag a point load along the beam and watch the diagrams follow:",[74,1234,1236],{"className":496,"code":1235,"language":498,"meta":79,"style":79},"\u003CDiagramStack v-model:load-at=\"at\" :solver=\"solveWithLoadAt(at)\" \u002F>\n",[81,1237,1238],{"__ignoreMap":79},[24,1239,1240,1242,1244,1247,1249,1252,1254,1256,1259,1261,1263,1265,1267,1269,1272,1275,1277],{"class":85,"line":86},[24,1241,505],{"class":137},[24,1243,1227],{"class":508},[24,1245,1246],{"class":89}," v-model",[24,1248,182],{"class":137},[24,1250,1251],{"class":89},"load-at",[24,1253,246],{"class":137},[24,1255,615],{"class":93},[24,1257,1258],{"class":137},"at",[24,1260,615],{"class":93},[24,1262,607],{"class":137},[24,1264,610],{"class":89},[24,1266,246],{"class":137},[24,1268,615],{"class":93},[24,1270,1271],{"class":89},"solveWithLoadAt",[24,1273,1274],{"class":137},"(at)",[24,1276,615],{"class":93},[24,1278,663],{"class":137},[14,1280,1281,1284],{},[18,1282,1227],{"href":1283},"\u002Fplot\u002Fdiagram-stack"," has the complete example.",[69,1286,1288],{"id":1287},"use-it-everywhere","Use it everywhere",[14,1290,1291],{},"To register both components globally instead of importing them where you use them:",[74,1293,1296],{"className":124,"code":1294,"filename":1295,"language":126,"meta":79,"style":79},"import { createApp } from 'vue'\nimport { EduBeamPlot } from '@edubeam\u002Fplot'\nimport App from '.\u002FApp.vue'\n\ncreateApp(App).use(EduBeamPlot).mount('#app') \u002F\u002F \u003CStructurePlot> and \u003CDiagramStack> in every template\n","main.ts",[81,1297,1298,1309,1320,1332,1336],{"__ignoreMap":79},[24,1299,1300,1302,1305,1307],{"class":85,"line":86},[24,1301,134],{"class":133},[24,1303,1304],{"class":137}," { createApp } ",[24,1306,141],{"class":133},[24,1308,841],{"class":93},[24,1310,1311,1313,1316,1318],{"class":85,"line":147},[24,1312,134],{"class":133},[24,1314,1315],{"class":137}," { EduBeamPlot } ",[24,1317,141],{"class":133},[24,1319,535],{"class":93},[24,1321,1322,1324,1327,1329],{"class":85,"line":154},[24,1323,134],{"class":133},[24,1325,1326],{"class":137}," App ",[24,1328,141],{"class":133},[24,1330,1331],{"class":93}," '.\u002FApp.vue'\n",[24,1333,1334],{"class":85,"line":161},[24,1335,151],{"emptyLinePlaceholder":150},[24,1337,1338,1341,1344,1347,1350,1353,1355,1358,1360],{"class":85,"line":213},[24,1339,1340],{"class":89},"createApp",[24,1342,1343],{"class":137},"(App).",[24,1345,1346],{"class":89},"use",[24,1348,1349],{"class":137},"(EduBeamPlot).",[24,1351,1352],{"class":89},"mount",[24,1354,261],{"class":137},[24,1356,1357],{"class":93},"'#app'",[24,1359,454],{"class":137},[24,1361,1362],{"class":157},"\u002F\u002F \u003CStructurePlot> and \u003CDiagramStack> in every template\n",[14,1364,1365,1366,1368,1369,1371,1372,796],{},"Named imports keep a bundle smaller: a page that imports only ",[81,1367,492],{}," gets neither ",[81,1370,1227],{}," nor the plugin. Both components render on the server too, in Nuxt or VitePress: see ",[18,1373,1375],{"href":1374},"\u002Fplot\u002Fembedding","Embedding",[69,1377,1379],{"id":1378},"next","Where to next",[1381,1382,1383,1391,1398,1405],"card-grid",{"cols":147},[1384,1385,1388],"card",{"icon":1386,"title":1387,"to":35},"lucide:dices","Exercises and tests",[14,1389,1390],{},"A different exercise for every student from a seed, with its answer key, printed or saved for LaTeX.",[1384,1392,1395],{"icon":1393,"title":1394,"to":40},"lucide:presentation","Slides and notes",[14,1396,1397],{},"Figures that build up click by click in Slidev, Vue or Beamer, and the same figures for notes.",[1384,1399,1402],{"icon":1400,"title":492,"to":1401},"lucide:frame","\u002Fplot\u002Fstructure-plot",[14,1403,1404],{},"Layers, dimensions, thumbnails, sizes, units, and reading values with the pointer.",[1384,1406,1408],{"icon":1407,"title":1227,"to":1283},"lucide:rows-3",[14,1409,1410],{},"A beam over its V, M and w diagrams, with a load the reader can drag.",[1412,1413,1414],"style",{},"html pre.shiki code .sScJk, html code.shiki .sScJk{--shiki-default:#6F42C1;--shiki-dark:#B392F0}html pre.shiki code .sZZnC, html code.shiki .sZZnC{--shiki-default:#032F62;--shiki-dark:#9ECBFF}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .szBVR, html code.shiki .szBVR{--shiki-default:#D73A49;--shiki-dark:#F97583}html pre.shiki code .sVt8B, html code.shiki .sVt8B{--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .sJ8bj, html code.shiki .sJ8bj{--shiki-default:#6A737D;--shiki-dark:#6A737D}html pre.shiki code .s4XuR, html code.shiki .s4XuR{--shiki-default:#E36209;--shiki-dark:#FFAB70}html pre.shiki code .sj4cs, html code.shiki .sj4cs{--shiki-default:#005CC5;--shiki-dark:#79B8FF}html pre.shiki code .s9eBZ, html code.shiki .s9eBZ{--shiki-default:#22863A;--shiki-dark:#85E89D}",{"title":79,"searchDepth":147,"depth":154,"links":1416},[1417,1418,1419,1420,1421,1422,1423],{"id":71,"depth":147,"text":72},{"id":113,"depth":147,"text":114},{"id":799,"depth":147,"text":800},{"id":1069,"depth":147,"text":1070},{"id":1221,"depth":147,"text":1222},{"id":1287,"depth":147,"text":1288},{"id":1378,"depth":147,"text":1379},"Install @edubeam\u002Fplot, draw a beam solved by @edubeam\u002Ffem with its loads, reactions and bending moment in Vue 3, redraw it as it changes, save it as SVG.","md","Introduction",{"source":1428},"site","\u002Fplot\u002Fgetting-started",{"title":5,"description":1424},"plot\u002Fgetting-started","SOL2LKEaSuWczhrObVedB_sXfiDJ3DX_7cBO32lXQJk",[1434,1435,1437,1439,1442,1444,1445,1446,1450,1453],{"path":1429,"title":5,"order":86,"group":1426},{"path":1401,"title":492,"order":147,"group":1436},"Components",{"path":1283,"title":1227,"order":154,"group":1438},null,{"path":1440,"title":1441,"order":161,"group":1438},"\u002Fplot\u002Ftheming","Theming and colours",{"path":35,"title":1387,"order":213,"group":1443},"Use cases",{"path":40,"title":1394,"order":232,"group":1438},{"path":1374,"title":1375,"order":252,"group":1438},{"path":1447,"title":1448,"order":285,"group":1449},"\u002Fplot\u002Fcomponents","Component API","Reference",{"path":1451,"title":1452,"order":326,"group":1438},"\u002Fplot\u002Fmodel","Plot model",{"path":1454,"title":1455,"order":359,"group":1438},"\u002Fplot\u002Ffunctions","Functions",1795108676391]