22
33package d3
44
5- @native
6- object d3 : Selectors <Any> {
7- val scale : ScaleBase = noImpl
5+ external object d3 : Selectors<Any> {
6+ override fun select ( selector : String ): Selection <Any >
7+ override fun selectAll ( selector : String ): Selection < Any >
88
9- fun <T > max (arr : Array <T >): Int = noImpl
10- fun <T > max (arr : Array <T >, map : (v: T ) -> Int ): Int = noImpl
9+ val scale: ScaleBase
10+
11+ fun <T > max (arr : Array <T >): Int
12+ fun <T > max (arr : Array <T >, map : (v: T ) -> Int ): Int
1113}
1214
13- @native
14- interface Selectors <D > {
15- fun select (selector : String ): Selection <D > = noImpl
16- fun selectAll (selector : String ): Selection <D > = noImpl
15+ external interface Selectors <D > {
16+ fun select (selector : String ): Selection <D >
17+ fun selectAll (selector : String ): Selection <D >
1718}
1819
19- @native
20- interface Selection <D > : Selectors <D > {
20+ external interface Selection <D > : Selectors <D > {
2121 fun attr (name : String ): String
2222 fun attr (name : String , value : Any ): Selection <D >
2323 fun <R > attr (name : String , valueFunction : (data: D ) -> R ): Selection <D >
@@ -29,17 +29,17 @@ interface Selection<D> : Selectors<D> {
2929 fun <R > classed (name : String , valueFunction : (data: D , index: Int ) -> R ): Selection <D >
3030
3131 fun style (name : String ): String ;
32- fun style (name : String , value : Any , priority : String? = null ): Selection <D >;
33- fun <R > style (name : String , valueFunction : (data: D ) -> R , priority : String? = null ): Selection <D >;
34- fun <R > style (name : String , valueFunction : (data: D , index: Int ) -> R , priority : String? = null ): Selection <D >;
32+ fun style (name : String , value : Any , priority : String? = definedExternally ): Selection <D >
33+ fun <R > style (name : String , valueFunction : (data: D ) -> R , priority : String? = definedExternally ): Selection <D >
34+ fun <R > style (name : String , valueFunction : (data: D , index: Int ) -> R , priority : String? = definedExternally ): Selection <D >
3535
36- fun text (): String ;
36+ fun text (): String
3737 fun text (value : Any ): Selection <D >;
3838 fun text (valueFunction : (data: D ) -> Any ): Selection <D >
3939 fun <R > text (valueFunction : (data: D , index: Int ) -> R ): Selection <D >
4040
41- fun <E > data (values : Array <out E >, key : ((data: E , index: Int? ) -> String )? = null ): UpdateSelection <E >
42- fun <E > data (values : (data: Any , index: Int? ) -> Array <E >, key : ((data: Any , index: Int? ) -> String )? = null ): UpdateSelection <E >
41+ fun <E > data (values : Array <out E >, key : ((data: E , index: Int? ) -> String )? = definedExternally ): UpdateSelection <E >
42+ fun <E > data (values : (data: Any , index: Int? ) -> Array <E >, key : ((data: Any , index: Int? ) -> String )? = definedExternally ): UpdateSelection <E >
4343
4444 fun append (name : String ): Selection <D >
4545
@@ -49,29 +49,27 @@ interface Selection<D> : Selectors<D> {
4949 fun <R > on (eventName : String , listener : (data: D , index: Int ) -> R , capture : Boolean ): Selection <D >
5050}
5151
52- @native
53- interface UpdateSelection <D > {
52+ external interface UpdateSelection <D > {
5453 fun enter (): EnterSelection <D >
5554}
5655
57- @native
58- interface EnterSelection <D > {
56+ external interface EnterSelection <D > {
5957 fun append (name : String ): Selection <D >
6058}
6159
62- @native
63- interface ScaleBase {
60+ external interface ScaleBase {
6461 fun linear (): LinearScale ;
6562}
6663
67- @native
68- interface QuantitiveScale : Function1 <Any , Any > {
64+ // / ???
65+ external interface QuantitiveScale /* : Function1<Any, Any>*/ {
6966 fun domain (values : Array <out Any >): QuantitiveScale
7067 fun domain (): Array <Any >
7168
7269 fun range (values : Array <out Any >): QuantitiveScale
7370 fun range (): Array <Any >
71+ @nativeInvoke
72+ operator fun invoke (a : Any ): Any
7473}
7574
76- @native
77- interface LinearScale : QuantitiveScale
75+ external interface LinearScale : QuantitiveScale
0 commit comments