[Pro] 1342 cells

Is there an easy way to get a table of 1342 rows x 3 columns in Freeway? The table tool only supports 200 rows and importing external html also doesn’t work :frowning:


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Wow, that’s a new one on me. Well, you could start with 200, and then insert additional rows 200 at a time. That ought to work. But seriously, what are you putting in a table that large? This sounds like something you should be creating programmatically, rather than hand-drawing and populating in Freeway.

Walter

On May 22, 2013, at 7:03 AM, DTP2 wrote:

Is there an easy way to get a table of 1342 rows x 3 columns in Freeway? The table tool only supports 200 rows and importing external html also doesn’t work :frowning:


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Hi Walter

On my website, I would like to offer a free color conversion table.

To achieve this I am building an Excel file with Pantone colors in the first column (1342 colors), the RAL equivalent in the second column and the color difference between these two in the third column. With the table kit action applied to the table, you should be able to change the sort order of the columns against each other.

At least, that’s the idea :wink: And since I don’t have any programming skills I’m afraid the only way I can do this.

Do you maybe have a good suggestion?


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Btw. I already successfully tried to use Google Docs and used that to show the Spreadsheet. But it uses an iFrame with ugly things I can not get rid of and the sorting functionality was lost that way.


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Export your Excel table as CSV. Draw a three-column by one row table, and put your text cursor in the first cell (double- or triple-click, can’t recall off-hand). Choose File / Import Text from the main menu, and navigate to your CSV file. Choose Comma Separated in the Import picker. Okay. Blammo. Freeway should build your table for you, with all data in place.

But personally, I would do this in a few lines of JavaScript. You could create the table contents programmatically, and set them up for sorting in one whack. (This example uses DIVs instead of a table, and does popup mouseovers instead of sorting, but hopefully you get the idea.)

http://scripty.walterdavisstudio.com/mr-chips.html

The data source is this JavaScript file (which you could translate from Excel’s CSV output):

http://scripty.walterdavisstudio.com/colors.js

I wrote this a couple of years ago or more, I would probably do a few things differently today. But view source (there’s hardly any “real” HTML in this page) to see how it works.

Walter

On May 22, 2013, at 9:21 AM, DTP2 wrote:

Hi Walter

On my website, I would like to offer a free color conversion table.

To achieve this I am building an Excel file with Pantone colors in the first column (1342 colors), the RAL equivalent in the second column and the color difference between these two in the third column. With the table kit action applied to the table, you should be able to change the sort order of the columns against each other.

At least, that’s the idea :wink: And since I don’t have any programming skills I’m afraid the only way I can do this.

Do you maybe have a good suggestion?


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

One more thing if you do it this way – make your page really tall (tens of thousands of pixels) in the page inspector. Freeway does funny things when you generate an object like this that runs off the bottom of the pasteboard.

Walter

On May 22, 2013, at 9:40 AM, Walter Lee Davis wrote:

Export your Excel table as CSV. Draw a three-column by one row table, and put your text cursor in the first cell (double- or triple-click, can’t recall off-hand). Choose File / Import Text from the main menu, and navigate to your CSV file. Choose Comma Separated in the Import picker. Okay. Blammo. Freeway should build your table for you, with all data in place.


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Hi Walter.

I’ve made my webpage 32000 pixels long and indeed did the CSV import into that table. Freeway warned me that it would overflow and offered to correct for it. Said yes and now my beach ball is spinning for already well over three hours.

It looks like it is still working on it, but I’m afraid this is not a workable solution.


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Hmmm. Well, maybe it’s time to force quit and try again with an even taller page. Or do it programmatically. Post your CSV on Gist (https://gist.github.com) so we can see where you’re starting. When you paste the URL here, be careful not to put it all alone on a line, otherwise the Web formatter is going to try to import it into the page, and you’ll have an infinitely tall Freewaytalk.net page to look at.

It’s going to be a very short bit of scripting to set up the table and populate it, once we convert that CSV format into JSON or something else that is easy for JavaScript to consume.

The way I would start this in Freeway is to draw a two-row table – one row for the heads (so the TableKit knows what to do), and the other as a template for all the 1,342 rows to follow. I am guessing that the rest can be done in about five lines of JS.

Walter

On May 22, 2013, at 9:57 AM, DTP2 wrote:

Hi Walter.

I’ve made my webpage 32000 pixels long and indeed did the CSV import into that table. Freeway warned me that it would overflow and offered to correct for it. Said yes and now my beach ball is spinning for already well over three hours.

It looks like it is still working on it, but I’m afraid this is not a workable solution.


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

This is the link to the file. Be aware that I’m still working on the full list. This is just a small part (200 rows, 3 column).

To be extra sure not to wreck Freewaytalk I’ve removed https from the beginning of the url ://gist.github.com/anonymous/5627858

Thanks so far!


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Okay, this looks like Tab-separated rather than Comma-separated, so that could explain your Freeway explosion right there. I’ll let you know when I have a recipe for you!

Walter

On May 22, 2013, at 10:21 AM, DTP2 wrote:

This is the link to the file. Be aware that I’m still working on the full list. This is just a small part (200 rows, 3 column).

To be extra sure not to wreck Freewaytalk I’ve removed https from the beginning of the url ://gist.github.com/anonymous/5627858

Thanks so far!


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

In Freeway when importing text into a table, you have the option for tab delimited, comma delimited or space delimited import. So I guessed this should be no problem.

But even if I make a small test version of the final file (200x3 table) and import this into Freeway, Freeway is EXTREMELY slow or even unresponsive when changing for example the font.

So I hope there is something you can do to help (again). Thanks in advance for all your efforts!


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Here’s the recipe to make JSON out of TSV:

The rest is pretty simple, I’ll post that in a moment.

Walter

On May 22, 2013, at 10:38 AM, DTP2 wrote:

In Freeway when importing text into a table, you have the option for tab delimited, comma delimited or space delimited import. So I guessed this should be no problem.

But even if I make a small test version of the final file (200x3 table) and import this into Freeway, Freeway is EXTREMELY slow or even unresponsive when changing for example the font.

So I hope there is something you can do to help (again). Thanks in advance for all your efforts!


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

The colors.js file is done. Well explained!


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Well, I’ve got some bad news – while it’s really simple to make a table out of the JSON, I can’t seem to hook the TableKit code to run on the generated table. It just won’t work. Sorry about that. Here’s the script to try it out there – you can see the table anyway.

In your second row of the table, make the content of the three cells as follows:

#{first}    #{second}    #{third}

Make note of the table’s Name/ID or Title (Freeway 6 or Freeway < 6). In the following code block, substitute that value EXACTLY for item1 in the first line.

var table = $('item1').down('table');
var tpl = new Template(table.down('tbody > tr').remove().outerHTML);
new Ajax.Request('colors.js', {
  method: 'get', 
  onSuccess: function(transport){
    var colors = eval(transport.responseText);
    colors.each(function(ary){
      var obj = {first: ary[0], second: ary[1], third: ary[2]};
      table.down('tbody').insert(tpl.evaluate(obj));
    });
  }
});

Paste that code into the DOM Loaded Observer editor in Protaculous 2. (Apply Protaculous 2 to the page, look in the Actions palette for that control.)

TableKit will set up the table for sorting, but any click on a header will result in an error, because at the moment that the TableKit JavaScript runs, the table has no rows in its tbody element, and the TableKit setup only runs once – before the JavaScript callback has populated the table with its new rows.

Walter

On May 22, 2013, at 11:07 AM, DTP2 wrote:

The colors.js file is done. Well explained!


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

And, because I don’t give up that easily (and because TableKit is a really well-written bit of code) there is a solution. Note the one extra line in the block of code below:

var table = $('item1').down('table');
var tpl = new Template(table.down('tbody > tr:last-child').remove().outerHTML);
new Ajax.Request('colors.js', {
  method: 'get', 
  onSuccess: function(transport){
    var colors = eval(transport.responseText);
    colors.each(function(ary){
      var obj = {first: ary[0], second: ary[1], third: ary[2]};
      table.down('tbody').insert(tpl.evaluate(obj));
    });
    TableKit.reload();
  }
});

That’s all it takes. Works perfectly now.

Walter

On May 22, 2013, at 11:32 AM, Walter Lee Davis wrote:

Well, I’ve got some bad news – while it’s really simple to make a table out of the JSON, I can’t seem to hook the TableKit code to run on the generated table. It just won’t work. Sorry about that. Here’s the script to try it out there – you can see the table anyway.


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

http://scripty.walterdavisstudio.com/color-table

Walter

On May 22, 2013, at 11:46 AM, Walter Lee Davis wrote:

That’s all it takes. Works perfectly now.


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

This is awesome!! Man, you make me SO happy with this. Please tell how I can achieve this myself.


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Read back three messages or so, to where I first said Bad News. That has the recipe for you to add this to your page. Then substitute the corrected code block and you’re good. Be sure to get the exact spelling and letter-case when you substitute your Name/ID for item1.

Walter

On May 22, 2013, at 12:15 PM, DTP2 wrote:

This is awesome!! Man, you make me SO happy with this. Please tell how I can achieve this myself.


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

I was so enthusiastic about the result I did not even notice the posts above :slight_smile:

Just followed the steps and presto! It works.

If I ever meet you in person, please remind me I owe you a couple of beers!


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

By the way, it doesn’t seem to work in Chrome on OSX :frowning: The top row is visible, but all the other cells aren’t.


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options