These are chat archives for canjs/canjs

27th
Jun 2018
ebriksmanish
@ebriksmanish
Jun 27 2018 10:49
Hello Everyone. I have made index.html , index.js, app.stache from "https://canjs.com/doc/guides/setup.html" guide.
And i have also made a file name services.js and import it in index.js like "import services from "./services";"
with content of "https://canjs.com/doc/can-connect.html" 's Demo Stuff.
Now there is problem . It is Appended on UL LI already but when i do tbody and tr , its not working . and another problem is that . How can i iterate it in app.stache file.
but for that I need the data in ViewModel , which i dont know how to fetch it in there.
Kindly Help
Gregg Roemhildt
@roemhildtg
Jun 27 2018 12:50

Hey guys, do you think its possible to use Canjs to create something like this?
https://bl.ocks.org/rpgove/53bb49d6ed762139f33bdaea1f3a9e1c

Or do you usually use a library like d3 to do this?

They're basically all just svg's positioned, so a stache template seems doable. I'm just curious if anyone had done something like this before and if there'd be any major caveats
Chasen Le Hara
@chasenlehara
Jun 27 2018 15:39
Hi @ebriksmanish, you can share your code here or put it in a JS Bin to show us the problem.
If you haven’t already, I’d recommend going through the chat guide, which shows some basics with can-connect: https://canjs.com/doc/guides/chat.html
This recipe might be helpful too in seeing some examples of using the #each helper: https://canjs.com/doc/guides/recipes/weather-report-simple.html
Chasen Le Hara
@chasenlehara
Jun 27 2018 15:49
@roemhildtg I’ve seen projects use D3… I’m not sure what the gotchas would be. I’d do a quick smoke test to see if the basics work.
or this this possible?
const Signal = DefineMap.extend("Signaldata", {
  seal: false
}, {
  graph: {identity: true, type: "string"},
  value: "string"
});
Chasen Le Hara
@chasenlehara
Jun 27 2018 18:40
Strings should be fine
Julian
@pYr0x
Jun 27 2018 18:42
k thx
Julian
@pYr0x
Jun 27 2018 22:26
can't i listen on promise with listenTo ?
this.listenTo("dataPromise", () => {
      setTimeout(() => {
        console.log("test");
      }, 10);

    })
dataPromise looks like
dataPromise: {
    get: function (lastSet, resolve) {
      return Select.getList({candidate: this.apiEndpoint}).then((response) => {
        this.select = "all";
        return response;
      });
    }
  },
Julian
@pYr0x
Jun 27 2018 23:26
can i set a nested property on a child VM?
<x-dashboard-logistics filter.period:raw="today" filter.organizations:raw="all"></x-dashboard-logistics>
my VM is
export const ViewModel = DefineMap.extend({
  filter: {
    Type: Filter
  }
});