@@ -60,14 +60,13 @@ public void drawLegend(VoltageLevelGraph graph, GraphMetadata metadata, StylePro
6060 protected List <BusLegendInfo > getBusLegendInfos (VoltageLevelGraph graph ) {
6161 VoltageLevel vl = network .getVoltageLevel (graph .getVoltageLevelInfos ().id ());
6262 return vl .getBusView ().getBusStream ()
63- .map (bus -> {
64- List <BusLegendInfo .Caption > captions = new ArrayList <>(4 );
65- captions .add (new BusLegendInfo .Caption (valueFormatter .formatVoltage (bus .getV (), "kV" ), "v" ));
66- captions .add (new BusLegendInfo .Caption (valueFormatter .formatAngleInDegrees (bus .getAngle ()), "angle" ));
67- captions .add (new BusLegendInfo .Caption (valueFormatter .formatPower (bus .getFictitiousP0 (), withDefaultUnit (svgParameters .getActivePowerUnit (), "MW" )), "fictitiousP0" ));
68- captions .add (new BusLegendInfo .Caption (valueFormatter .formatPower (bus .getFictitiousQ0 (), withDefaultUnit (svgParameters .getReactivePowerUnit (), "MVar" )), "fictitiousQ0" ));
69- return new BusLegendInfo (bus .getId (), captions );
70- }).toList ();
63+ .map (bus -> new BusLegendInfo (bus .getId (), List .of (
64+ new BusLegendInfo .Caption (valueFormatter .formatVoltage (bus .getV (), "kV" ), "v" ),
65+ new BusLegendInfo .Caption (valueFormatter .formatAngleInDegrees (bus .getAngle ()), "angle" ),
66+ new BusLegendInfo .Caption (valueFormatter .formatPower (bus .getFictitiousP0 (), withDefaultUnit (svgParameters .getActivePowerUnit (), "MW" )), "fictitiousP0" ),
67+ new BusLegendInfo .Caption (valueFormatter .formatPower (bus .getFictitiousQ0 (), withDefaultUnit (svgParameters .getReactivePowerUnit (), "MVar" )), "fictitiousQ0" )
68+ )))
69+ .toList ();
7170 }
7271
7372 private static String withDefaultUnit (String configuredUnit , String defaultUnit ) {
0 commit comments