About DuneSt / ChartJs

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

About DuneSt / ChartJs

Sven Van Caekenberghe-2
Hi,

I am trying to use DuneSt / ChartJs [ https://github.com/DuneSt/ChartJs ] and it looks good. Thanks for another nice library.

My first question is about loading the code. I would like to load the minimum possible. I guess the stylesheet code is needed, but not the prism code ?

NeoJSON and Seaside are already in my project's dependencies, but Seaside3 seems to never resolve to the same thing, so I would like to skip that. Is that possible ? I have this issue often with Seaside. I could fork and edit the baseline, but I'd rather not.

I got a Bar chart on 2D data running right away.

But how can I use 'horizontalBar' as type ?

var myBarChart = new Chart(ctx, {
    type: 'horizontalBar',
    data: data,
    options: options
});

I see that the types are encoded a classes, but the list seems rather limited.

Thx,

Sven


Reply | Threaded
Open this post in threaded view
|

Re: About DuneSt / ChartJs

Guillaume Larcheveque


Le mar. 11 févr. 2020 à 17:07, Sven Van Caekenberghe <[hidden email]> a écrit :
Hi,

I am trying to use DuneSt / ChartJs [ https://github.com/DuneSt/ChartJs ] and it looks good. Thanks for another nice library.
You're welcome and we are pleased that you use it :-) 

My first question is about loading the code. I would like to load the minimum possible. I guess the stylesheet code is needed, but not the prism code ?
You are totally right, Prism is required by the demo to display the code. You will not load it by using the 'core' group 

NeoJSON and Seaside are already in my project's dependencies, but Seaside3 seems to never resolve to the same thing, so I would like to skip that. Is that possible ? I have this issue often with Seaside. I could fork and edit the baseline, but I'd rather not.
I have the same opinion, if you have a solution to manage it in a nice way i would be pleased to add it. I only see as a solution to create a group that do not load Seaside3 but maybe Cyril know a better way to do it (he is far better than me about baselines) 

I got a Bar chart on 2D data running right away.

But how can I use 'horizontalBar' as type ?

var myBarChart = new Chart(ctx, {
    type: 'horizontalBar',
    data: data,
    options: options
});

I see that the types are encoded a classes, but the list seems rather limited.
We implemented the minimum that is required for us. It is really easy to add new ones as you already discovered. I will add these as soon as possible or if you already did it, create a pull request. There is many improvement that can be done in this project and it would be great to have your contribution about it.

We will move to the new version of the ChartJs library when we will have time to improve it. Of course the API of our project will stay the same and changes will not impact your project.

Thx,

Sven




--
Guillaume Larcheveque

Reply | Threaded
Open this post in threaded view
|

Re: About DuneSt / ChartJs

Pierce Ng-3
In reply to this post by Sven Van Caekenberghe-2
On Tue, Feb 11, 2020 at 05:06:44PM +0100, Sven Van Caekenberghe wrote:
> NeoJSON and Seaside are already in my project's dependencies, but
> Seaside3 seems to never resolve to the same thing, so I would like to
> skip that. Is that possible ? I have this issue often with Seaside. I
> could fork and edit the baseline, but I'd rather not.
 
I do the following near the top of my load script:

  Metacello new
    baseline: 'Seaside3';
    repository: '...';
    load;
    lock.

And when loading other packages that may want to load another version of
Seaside:

  Metacello new
    baseline: 'whatever';
    repository: '...';
    onConflictUseLoaded;
    load.

I tried doing ifTrue:ifFalse: conditional loading in my baseline to test
for Seaside, but it didn't work.
 
Pierce


Reply | Threaded
Open this post in threaded view
|

Re: About DuneSt / ChartJs

Sven Van Caekenberghe-2
In reply to this post by Guillaume Larcheveque
Hi Guillaume,

Thank you for your reply.

I see that the version supported/implemented in DuneSt/ChartJs is 1.0.2 (from 2015) while the current Chart.js version is 2.0, so it would probably be time for an upgrade.

I also don't know the perfect answer to the Seaside dependency, I'll write some more in another reply.

I tried making a sub class of ChartBar called ChartHorizontalBar overwriting only

forChartJS
        ^ 'HorizontalBar'  

and then using that as an argument to #chartType: but alas that did not work.

I must admit that I do not really understand how I have to mentally map the official JavaScript documentation to the model in Pharo and how it is implemented (#forChartJS does not seem to be used as argument/value but as a function call).

Sven

> On 11 Feb 2020, at 20:12, Guillaume Larcheveque <[hidden email]> wrote:
>
>
>
> Le mar. 11 févr. 2020 à 17:07, Sven Van Caekenberghe <[hidden email]> a écrit :
> Hi,
>
> I am trying to use DuneSt / ChartJs [ https://github.com/DuneSt/ChartJs ] and it looks good. Thanks for another nice library.
> You're welcome and we are pleased that you use it :-)
>
> My first question is about loading the code. I would like to load the minimum possible. I guess the stylesheet code is needed, but not the prism code ?
> You are totally right, Prism is required by the demo to display the code. You will not load it by using the 'core' group
>
> NeoJSON and Seaside are already in my project's dependencies, but Seaside3 seems to never resolve to the same thing, so I would like to skip that. Is that possible ? I have this issue often with Seaside. I could fork and edit the baseline, but I'd rather not.
> I have the same opinion, if you have a solution to manage it in a nice way i would be pleased to add it. I only see as a solution to create a group that do not load Seaside3 but maybe Cyril know a better way to do it (he is far better than me about baselines)
>
> I got a Bar chart on 2D data running right away.
>
> But how can I use 'horizontalBar' as type ?
>
> var myBarChart = new Chart(ctx, {
>     type: 'horizontalBar',
>     data: data,
>     options: options
> });
>
> I see that the types are encoded a classes, but the list seems rather limited.
> We implemented the minimum that is required for us. It is really easy to add new ones as you already discovered. I will add these as soon as possible or if you already did it, create a pull request. There is many improvement that can be done in this project and it would be great to have your contribution about it.
>
> We will move to the new version of the ChartJs library when we will have time to improve it. Of course the API of our project will stay the same and changes will not impact your project.
>
> Thx,
>
> Sven
>
>
>
>
> --
> Guillaume Larcheveque
>


Reply | Threaded
Open this post in threaded view
|

Re: About DuneSt / ChartJs

Sven Van Caekenberghe-2
In reply to this post by Pierce Ng-3
Hi Pierce,

I did actually use the following expression:

Metacello new
   githubUser: 'DuneSt' project: 'ChartJs' commitish: 'master' path: 'src';
   baseline: 'ChartJs';
   onUpgrade: [ :e | e useIncoming ];
   onConflictUseLoaded;
   onWarningLog;
   load.

Thinking about it, maybe the #onUpgrade: and #onConflictUseLoaded can't used together, I don't know.

I normally load Seaside3 as a dependency to Bootstrap:

  spec baseline: 'Bootstrap' with: [ spec repository: 'github://astares/Seaside-Bootstrap:master/src' ].

which loads Seaside as:

seaside3: spec
  spec
    baseline: 'Seaside3'
    with: [ spec
      loads: #('default' 'REST');
      repository: 'github://SeasideSt/Seaside:master/repository' ]

while ChartJS uses:

seaside3: spec
  spec baseline: 'Seaside3' with: [ spec repository: 'github://SeasideSt/Seaside:v3.4.x/repository' ]

Maybe the differences in URL (the version tag) and maybe also the groups make them incompatible/different ?

Sven

> On 12 Feb 2020, at 01:10, Pierce Ng <[hidden email]> wrote:
>
> On Tue, Feb 11, 2020 at 05:06:44PM +0100, Sven Van Caekenberghe wrote:
>> NeoJSON and Seaside are already in my project's dependencies, but
>> Seaside3 seems to never resolve to the same thing, so I would like to
>> skip that. Is that possible ? I have this issue often with Seaside. I
>> could fork and edit the baseline, but I'd rather not.
>
> I do the following near the top of my load script:
>
>  Metacello new
>    baseline: 'Seaside3';
>    repository: '...';
>    load;
>    lock.
>
> And when loading other packages that may want to load another version of
> Seaside:
>
>  Metacello new
>    baseline: 'whatever';
>    repository: '...';
>    onConflictUseLoaded;
>    load.
>
> I tried doing ifTrue:ifFalse: conditional loading in my baseline to test
> for Seaside, but it didn't work.
>
> Pierce
>
>


Reply | Threaded
Open this post in threaded view
|

Re: About DuneSt / ChartJs

Sven Van Caekenberghe-2
In reply to this post by Sven Van Caekenberghe-2
I added a comment and some code to

https://github.com/DuneSt/ChartJs/issues/1

> On 12 Feb 2020, at 10:54, Sven Van Caekenberghe <[hidden email]> wrote:
>
> Hi Guillaume,
>
> Thank you for your reply.
>
> I see that the version supported/implemented in DuneSt/ChartJs is 1.0.2 (from 2015) while the current Chart.js version is 2.0, so it would probably be time for an upgrade.
>
> I also don't know the perfect answer to the Seaside dependency, I'll write some more in another reply.
>
> I tried making a sub class of ChartBar called ChartHorizontalBar overwriting only
>
> forChartJS
> ^ 'HorizontalBar'  
>
> and then using that as an argument to #chartType: but alas that did not work.
>
> I must admit that I do not really understand how I have to mentally map the official JavaScript documentation to the model in Pharo and how it is implemented (#forChartJS does not seem to be used as argument/value but as a function call).
>
> Sven
>
>> On 11 Feb 2020, at 20:12, Guillaume Larcheveque <[hidden email]> wrote:
>>
>>
>>
>> Le mar. 11 févr. 2020 à 17:07, Sven Van Caekenberghe <[hidden email]> a écrit :
>> Hi,
>>
>> I am trying to use DuneSt / ChartJs [ https://github.com/DuneSt/ChartJs ] and it looks good. Thanks for another nice library.
>> You're welcome and we are pleased that you use it :-)
>>
>> My first question is about loading the code. I would like to load the minimum possible. I guess the stylesheet code is needed, but not the prism code ?
>> You are totally right, Prism is required by the demo to display the code. You will not load it by using the 'core' group
>>
>> NeoJSON and Seaside are already in my project's dependencies, but Seaside3 seems to never resolve to the same thing, so I would like to skip that. Is that possible ? I have this issue often with Seaside. I could fork and edit the baseline, but I'd rather not.
>> I have the same opinion, if you have a solution to manage it in a nice way i would be pleased to add it. I only see as a solution to create a group that do not load Seaside3 but maybe Cyril know a better way to do it (he is far better than me about baselines)
>>
>> I got a Bar chart on 2D data running right away.
>>
>> But how can I use 'horizontalBar' as type ?
>>
>> var myBarChart = new Chart(ctx, {
>>    type: 'horizontalBar',
>>    data: data,
>>    options: options
>> });
>>
>> I see that the types are encoded a classes, but the list seems rather limited.
>> We implemented the minimum that is required for us. It is really easy to add new ones as you already discovered. I will add these as soon as possible or if you already did it, create a pull request. There is many improvement that can be done in this project and it would be great to have your contribution about it.
>>
>> We will move to the new version of the ChartJs library when we will have time to improve it. Of course the API of our project will stay the same and changes will not impact your project.
>>
>> Thx,
>>
>> Sven
>>
>>
>>
>>
>> --
>> Guillaume Larcheveque
>>
>