The Objectsheet Application Environment
Objectsheet sections can be scripted into any webpage, or can be used as a stand-alone application. As a stand-alone application, the Objectsheet has the following features and rules:
- Layout By default, Objectsheet sections can be placed anywhere within the application window and moved around independently. An alternate layout for Sections is stacked (see the application's "Options" menu). In the stacked layout, Sections are laid out and calculated vertically down the application window. In stacked layout, the spacing between Sections is maintained between sections even if a section's height changes.
- Cut and Paste Tables You can cut data from a spreadsheet and paste it into an Objectsheet table using Ctrl-Shift-V. You can then copy the values out of the table using Ctrl-Shift-C and paste them back into the spreadsheet.
- Selecting Rows and Columns You can select individual rows and columns by highlighting row label cells (the leftmost cell in the row) or the column selector (the thin bar right below the column name). For the row label cells, you can also click and drag.
- When cutting and pasting, only the selected rows and columns will be cut or pasted.
- When inserting rows and columns, rows or columns will be inserted just before the last row/column highlighted.
- When deleting rows or columns, the last highlighted row or column will be deleted.
- Calculation Order Sections are calculated in the order they appear in the Sections menu. You can see and change this order (see below).
- Deploying Objectsheets can be configured in a deployment mode that protects all rules (formulas, formats, etc.) from change ("Lock Template" in the Options menu below). Natural separation of rules and data makes this easy and obvious on the Objectsheet.
This is one of the most important advantages of the Objecsheet over spreadsheets, where simple data entry and manipulation can easily introduce errors.
The current implementation of the Objectsheet application is responsive for models up to about 1,000 cells, or about 10,000 cells when using suggested performance tricks.
Objectsheet Application Menu
Most of the Objectsheet menu items behave like normal menu selections. Some of the menu items incorporate their own data entry instead of using separate dialog boxes. For instance, the File menu has a text field where you can type in a filename. Other menu selections cause Objectsheet sections to be created. For instance, in the File menu, clicking "Open..." opens a Table to be created with all the files in the current directory; clicking on a filename opens that file.
The following notes discuss details of each menu.
File Menu
The file menu allows you to load and save objectsheet ".os" files on your local hard drive or over the Internet. For local files on your computer, your browser may require minor configuration to open or save files:
- For internet explorer (6 or later), attempting to get a directory listing or save a file may generate an infobar warning:
. You can either click the infobar and select "accept", or from the IE Menu, select Tools > Internet Options..., then select the Advanced tab; under Security, check "Allow active content to run in files in files on My Computer.
- For Mozilla,
- The Open... dialog allows you to open saved Objectsheet files, either over the Internet or on your computer's local file. Click on a file name to open. You can also sort files by clicking on the bars next to the column names. The Objectsheet treats files differently based on the file extension:
- If you select an ".os" (Objectsheet) file, the file will be loaded and will replace whatever you were working on.
- If you select a ".csv" file, the contents will be placed into a new Table, added to the current open file.
- If you select an ".htm" or ".html" file, the contents will be placed into an HTML Section, added to the current open file.
- If you select another file type, the file will be opened up in a separate web browser window.
- The Dir menu item shows the current directory. Click "set..." to select a new working directory. You can also type a new working directory name into the Dir box. The directory can be a local directory (e.g., C:\... on windows, /usr/home/... on linux, /home/... on Macintosh) or can be a web URL (http://....). For web URLs, the Objectsheet can get directory information when a web server's "automatic index page" is present.
- You can edit the name in the File box as an alternative to selecting one via the Open... dialog. This is also how you rename files prior to Saving.
- The Save item does not use a dialog box-- to save a copy an Objectsheet, just type the new name into the File box, then select "Save". Note that you may be asked permission for the browser to save to your local computer; you will need to select "yes" to continue saving.
- The Hide Table field provides a safety check against loading tables that are too large to display quickly. If any table has more than that number of cells, it will be loaded, but not displayed (ie., the filter in the section Template will be set to "0").
Edit Menu
The Undo and Redo commands currently only work for simple table cell changes. They do not yet work for table row/column edits or for other Section types (HTML and Scratch).
Insert Menu
The insert menu simply adds a new, blank section of the type indicated. The basic section types are "Table", "Scratch", and "Html". The "Eng" table is one that allows you to use engineering suffixes (k for x1,000; u for /1,000,000; etc.) for all your calculations.
Note: It is easy to add preconfigured Sections to the Insert menu for easy recall. While currently, this requires modifying source code, an extension mechanism is easy to implement.
Options Menu
The Options menu allows you to change features across all Objectsheet sections. These options are safety features that protect the structure and rules of an Objectsheet application and make them easier to navigate when deployed.
- Stacked The stacked layout shows each table in order, vertically and non-overlapping. Non-overlapping means that spacing between sections is maintained when you grow or shrink a section's size. When stacked, sections are calculated top-to-bottom. You can reorder the stacking (and calculation) order via the Sections menu (see below). When stacked, tables cannot be moved around using the mouse, only by reordering them via the Sections menu.
- Lock Template Lock Template freezes all Section templates, including the column name cells (table sections) and the section name cell. This effectively prevents accidental changes to the workings of an Objectsheet.
- Can Close Normally, a section can be removed from the Objectsheet simply by clicking its close box. Currently, the contents of an accidentally closed section are not retrievable, as the undo feature does not yet work with close. To provide protection, not only during use but during development, uncheck the Can Close box.
- Alt Row Sizer (Tables only) Normally, Tables include a gray resize bar on the bottom which you click or drag (in conjunction with row highlights) to add and remove rows. Clicking the Alt Row Sizer checkbox changes this to a simpler mechanism: the bottom resize bar becomes larger and easier to click, and each row gets a delete button (the red "x" next to the row number). This can be handy for deploying applications to make it more obvious how to add and remove rows.
Help Menu
The help menu has links for a general function and method reference and subsets of the reference page for javascript functions and shortcuts. There is also links to the Objectsheet tutorial and homepage, as well as an "About" panel. The about panel is an example of a "canned" Html Section.
Sections Menu
The Sections menu allows you to modify options for each section individually.
- Sections can be reordered by typing a new number under the order column. This also changes the order in which sections are calculated. When using the "Stacked" option under the Options Menu, reordering also affects the order they are displayed. When you change a section's order number, all of the order numbers are automatically reindexed, so feel free to use a decimal order to place a section between two existing sections.
- The visible column hides the section completely. This does not affect how a section is calculated, just whether it's displayed.
- The hide title checkboxes simply hide a section's titlebar. This is most useful with HTML sections to create standalone labels in your application.
- The resize column affects whether the horizontal or vertical grey bars are shown. Click the checkbox to show the resize bars, uncheck to hide them.
Note: when the lockTemplate option is checked (options menu), the right-hand resize bar on tables are hidden to prevent adding or removing columns.
- The Off Line column, when checked, does not calculate that section during a normal calculation cycle. This is useful for performance purposes with large tables that don't need to be calculated "live". When the Off Line box is checked, you can still manually calculate a section by placing your cursor in an editable text box and typing Ctrl-Enter.
To experiment with the Objectsheet application environment you can either download the application to your own machine or use the web browser environment. Go to the download page to do this.
Objectsheet File Format
The Objectsheet uses a slightly modified JSON format. The modifications are:
- The first line of the file is a variable assignment that allows the file to be loaded like any other Javascript file. Ignore that line and the rest of the file is JSON.
- The Objectsheet does not put double quotes around JSON keys that are identifiers (ie., alphanumeric and underscore, no spaces). This may be fixed in a future version.
Objectsheet files are denoted by a ".os" extension.
If you read a .os file using a JSON parser (after removing the first line), the data within a Table Section is located at the following path: JSONobject.isections[sectionIndex].form[rowNumber][columnName]. The sectionIndex is the row number in the Sections Menu.
Compatible Browsers
The Objectsheet has been tested and is known to work with: Mozilla (1.5+, 2.x, 3.x), Internet Explorer (5.x, 6.x), Safari (3.1.2), and Opera (9). It most probably works with earlier and later versions of these browsers, but has not been tested.
If you run objectsheet.html from your local hard drive, you can save .os files locally if you are using IE or Mozilla Browsers. You will have to give the browser permission (typically through a dialog box) to allow the browser to interact with your hard drive.
|