@@ -11,6 +11,7 @@ import (
1111 "sort"
1212
1313 "gonum.org/v1/plot"
14+ "gonum.org/v1/plot/text"
1415 "gonum.org/v1/plot/tools/bezier"
1516 "gonum.org/v1/plot/vg"
1617 "gonum.org/v1/plot/vg/draw"
@@ -40,7 +41,7 @@ type Sankey struct {
4041 // TextStyle specifies the default stock label
4142 // text style. Styles can be modified for
4243 // individual stocks.
43- TextStyle draw .TextStyle
44+ TextStyle text .TextStyle
4445
4546 flows []Flow
4647
@@ -60,7 +61,7 @@ type Sankey struct {
6061 // The default function uses the default TextStyle, color and LineStyle
6162 // specified above for all stocks; zero horizontal and vertical offsets;
6263 // and the stock label as the text to be printed on the plot.
63- StockStyle func (label string , category int ) (lbl string , ts draw .TextStyle , xOff , yOff vg.Length , c color.Color , ls draw.LineStyle )
64+ StockStyle func (label string , category int ) (lbl string , ts text .TextStyle , xOff , yOff vg.Length , c color.Color , ls draw.LineStyle )
6465
6566 // stocks arranges the stocks by category.
6667 // The first key is the category and the seond
@@ -178,7 +179,7 @@ func NewSankey(flows ...Flow) (*Sankey, error) {
178179 if err != nil {
179180 return nil , err
180181 }
181- s .TextStyle = draw .TextStyle {
182+ s .TextStyle = text .TextStyle {
182183 Font : fnt ,
183184 Rotation : math .Pi / 2 ,
184185 XAlign : draw .XCenter ,
@@ -191,7 +192,7 @@ func NewSankey(flows ...Flow) (*Sankey, error) {
191192 return s .Color , s .LineStyle
192193 }
193194
194- s .StockStyle = func (label string , category int ) (string , draw .TextStyle , vg.Length , vg.Length , color.Color , draw.LineStyle ) {
195+ s .StockStyle = func (label string , category int ) (string , text .TextStyle , vg.Length , vg.Length , color.Color , draw.LineStyle ) {
195196 return label , s .TextStyle , 0 , 0 , s .Color , s .LineStyle
196197 }
197198
0 commit comments