SlideShare uma empresa Scribd logo
1 de 48
Baixar para ler offline
DocEng2011, September 19– 22, 2011, Mountain View, California

Building
Table Formatting Tools
Mihai Bilauca

Patrick Healy

Department of Computer Science and Information Systems
University of Limerick, Ireland

Supported by Science Foundation Ireland under the research programme 01/P1.2/C009,
Mathematical Foundations, Practical Notations, and Tools for Reliable Flexible Software.
Building Table Formatting Tools
Why this paper?
• Tables are widely used for presenting logical
relationships between data items;
• Widely spread WYSIWYG tools only control
presentation parameters;
• Existing tools have limitations;
• Authoring tables is hard, time consuming and error
prone;
Building Table Formatting Tools

Slide 2 of 48
Building Table Formatting Tools
Overview
A) A review of logical table models;
B) Table Drawing Tool Prototype: Typographical issues;
C) Automated table layout optimization for tables with
spanning cells:

Report experimental results for large tables

Comparison with previous models;

A simplified solution for nested tables;
A) Conclusions
Building Table Formatting Tools

Slide 3 of 48
Logical table models

Building Table Formatting Tools

Slide 4 of 48
Logical table models
1985 Beach
• An for Tioga DS that formats itself based on given dimensions
• A “grid” with table topology and table geometry
1989 Cameron
• Identifies 3 mental processes: structure, content & visual editing
1989 Vanoirbeek
• a multidimensional collection of logically connected data items
• each dimension is divided in rubrics to classify data items
• merged items where an item is connected to multiple rubrics
• defines tables in a language based on attribute grammars

Building Table Formatting Tools

Slide 5 of 48
Logical table models
1996 Wang
• layout structure (topology & typographic style)
• logical structure: a mathematical model based on unordered
sets
• identified operations at table, category and label level
2010 Parnas
• meaningful expressions which can be evaluated and validated
• indexation separates table semantics from appearance
• An indexed set of grids < GS, I, x > and each grid is an indexed
set of expressions
• A grid < SetExp, J, y > is a set of expressions SetExp, an indexed
set J and a mapping y between SetExp and J
Building Table Formatting Tools

Slide 6 of 48
Table Drawing Tool Prototype:
Typographical issues;

Building Table Formatting Tools

Slide 7 of 48
Table Drawing Tool - TDT
• Part of a larger project developed at University of Limerick
Ireland, a tabular expressions tool:
–
–
–
–

Table Input Tool;
Kernel;
Evaluation module;
Table Drawing Tool;

• concerned only with drawing tables on a rendering device
depending on the table layout using a layout optimizer;
• current version supports rectangular tables which can be
rendered in PDF using a layout optimizer based on IBM ILOG
OPL;

Building Table Formatting Tools

Slide 8 of 48
TDT Circular layout?

Table 1 is represented with both rectangular and a circular layout

Building Table Formatting Tools

Slide 9 of 48
TDT Device
The device is an abstract object that must provide functions to:
• open and close the device;
• set colours, fill colours, line styles;
• font settings (font family, style, size);
• vertical and horizontal alignment;
• text spacing (word, character and line spacing);
• draw curves (bezier);
• support for images;
• support for paging the content;
The device must return measurement units in the TDT coordinate
system;

Building Table Formatting Tools

Slide 10 of 48
TDT Hierarchical model
A table layout tool needs to be as powerful as a page
layout tool
• TDT implements a hierarchical structure of containers
(similar to the CSS)
• It is each container’s responsibility to format itself
• Each container must implement computeLayout and render
on device functions
• For drawing tables TDT implements a box model;
Support for
• Hierarchical propagation of typographical parameters
• Layered control of typographical parameters

Building Table Formatting Tools

Slide 11 of 48
TDT The Box model

For drawing tables TDT implements a box model (similar to CSS)

Building Table Formatting Tools

Slide 12 of 48
TDT Typographical issues
• table layout: a caption and a layout (rectangular, circular,
custom)
• caption: label, number and caption text; Global numbering
styles must be defined; example: Table A.12 Test data
• laying containers: fixed and floating positioning. lay floating
(nonfixed) containers on lines; complexity is increased with
fixed position containers
• lines: styles and joins: pattern, line cap, line join and miter
limit; The pattern is defined as a dash array and a phase
• margins: add or merge adjacent margins?
Building Table Formatting Tools

Slide 13 of 48
TDT Typographical issues
• coordinates space: TDT uses a coordinate system with points
(1/72 inch)
• text direction: right-to-left, top-to-bottom
• equations: TDT uses WebEQ to render MathML expressions
• images: conversion from pixels in the units of the coordinate
system;
• borders: without a clear definition of the lines styles, dealing
with borders can be a major cause of frustration:
– border space;
– border alignment;
– border priority;
Building Table Formatting Tools

Slide 14 of 48
Border conflicts in Open Office

Building Table Formatting Tools

Slide 15 of 48
Automated table layout optimization

Building Table Formatting Tools

Slide 16 of 48
Building Table Formatting Tools
Table layout optimization
• For applications where finding the layout with the
minimum height for a given width is important;
• Because it is exact (not based on heuristics);
• Priority should be given to user constraints imposed
by space limitations or other aesthetic criteria;

Building Table Formatting Tools

Slide 17 of 48
The Table Layout Problem
Find a layout λ of a table ℑ with minimum
such that

height (λ )

width(λ ) < W
W – a given page width

Building Table Formatting Tools

Slide 18 of 48
Definitions (Anderson and Sobti)
ℑ , m x n table, m rows, n columns, λ

is a layout of ℑ

k
k
Ci , j : {( wij , hij ) | 1 ≤ k ≤ K ij }

is the set of configurations for cell i,j with

1 ≤ ki , j ≤ K ij the index of the configuration selected from Ci,j
m

height (λ ) = ∑ hi
i =1

n

width(λ ) = ∑ w j
j =1

where hi = max(hi,j) for each row i, wj = max(wi,j) for each column j
ki , j
i, j

hi , j = h
Building Table Formatting Tools

ki , j
i, j

wi , j = w

Slide 19 of 48
Cell configurations
Example:
k
k
Ci , j : {(hij , wij ) | 1 ≤ k ≤ K ij }
Cell configurations for cell i,j
this blue sky

Building Table Formatting Tools

this blue
sky

this
blue
sky

Slide 20 of 48
IP definition – simple tables
m

n

minimize∑ max hi , j ,k ⋅ xi , j ,k
i =1

j =1

subject to
n

1)

m

∑ max w
i =1

j =1

2)
where
Building Table Formatting Tools

∑x

i , j ,k

i , j ,k

⋅ xi , j ,k ≤ W

= 1,

x ∈ {0,1}
1 ≤ ki , j ≤ K i , j
Slide 21 of 48
IP – Tables with spanning cells
The height and width of a spanning cell i,j is

1)

2)

S

h
i, j

S

w
i, j

hi , j =
wi , j =

i + S ih, j

∑h

r

r =i

j + S iwj
,

∑w
c= j

c

the number of additional rows spanned by cell i,j
the number of additional columns spanned by cell i,j

Building Table Formatting Tools

Slide 22 of 48
Tables with spanning cells
Two cases:

A) cell 1,1 spans wide
columns

Building Table Formatting Tools

B) cell 1,1 spans narrow columns

Slide 23 of 48
Tables with spanning cells
A cell spanning narrow columns requires “glue”

“Glue” is a concept similar to the “glue” introduced by Knuth
- it stretches and shrinks as required;
- its value can be further constraint;

Building Table Formatting Tools

Slide 24 of 48
Tables with spanning cells
For a spanning cell i,j the equations 1) and 2) become:

1)

2)

g

hi , j =
wi , j =

i + S ih, j

∑ (h

r

r =i

j + S iwj
,

∑ (w
c= j

c

+g )
h
r

+g )

h
r

the vertical glue for row r

w
c

w
c

the horizontal glue for column c

g

Building Table Formatting Tools

Slide 25 of 48
Tables with spanning cells
a)

hi , j = ∑ hi , j ,k ⋅ xi , j ,k

m

c)

i =1

k

b)

wi , j = ∑ wi , j ,k ⋅ xi , j ,k

n

d)

where

x, y, z ∈ {0,1}
Building Table Formatting Tools

h ∈ Hi ,

r
i

wj = ∑ w ⋅ z
j =1

k

r
i

hi = ∑ h ⋅ y
r
i

c
j

c
j

w ∈W j
c
j

1 ≤ k ≤ Ci , j , 1 ≤ c ≤ W j ,

1 ≤ r ≤ Hi
Slide 26 of 48
IP definition – simple tables
m

minimize∑ hir ⋅ yir + g ih
i =1

subject to
n

1)

wcj ⋅ z cj + g w ≤ W
∑
j

4)*

j =1

2)

3)

hi , j ≤
wi , j ≤

i + S ih, j

(hr + g rh )
∑
( wc + g cw )
∑

i , j ,k

= 1, ∀i, j

m

5)

r =i

j + S iwj
,

∑x

yir = 1
∑
i =1
n

6)

z cj = 1
∑
j =1

c= j

* dummy cells (0,0) are inserted for spanned cells
Building Table Formatting Tools

Slide 27 of 48
Table Layout problem is NP-complete
Demonstrated by:
• 1996 Wang - demonstration using large
integers;
• 1999 Anderson and Sobti - using
reductions of the clique problem to the
table layout, on simple tables.

Building Table Formatting Tools

Slide 28 of 48
OPL
OPL – Optimization Programming Language
designed for solving combinatorial optimization
problems.
• support for:
– MIP and constraint programming including search specification;
– logical and higher order constraints;
– support for scheduling and resource allocation applications;

• shares structure and syntax features with mathematical
programming languages such as AMPL or GAMS
• problems can be formulated in a language similar to their
algebraic notation

Building Table Formatting Tools

Slide 29 of 48
OPL Keywords
dvar – decision variable. The purpose of an OPL

model is to find values for the decision variables
such that all constraints are satisfied
dexpr - to express decision variables in a more

compact way
{dataType} - set of type dataType
<x,y> - represents a tuple value;
Building Table Formatting Tools

Slide 30 of 48
TSC Model - Data types
tuple Conf {int w; int h;}
tuple CellConf {int i; int j; Conf c;}
int pageW;
// page width
{CellConf} configs; // set of cell configurations
sample data: configs = {<0,0, <127,10>>, <0,0, <92,20>>,
<0,1, <75,20>>,<0,2, <65,10>>,…,}

{Cell} cells = {<i,j> | <i,j,k> in configs}
{int} rows = {i | <i,j> in cells}
{int} cols = {j | <i,j> in cells}
Building Table Formatting Tools

Slide 31 of 48
TSC model - Additional data
// for each column j, the set of possible widths
{Pair} colWset = {<j, k.w> | <i,j,k> in configs:
Sw[<i,j>==0};
// for each row i, the set of possible heights
{Pair} rowHset = {<i, k.h> | <i,j,k> in configs:
Sh[<i,j>==0};

Building Table Formatting Tools

Slide 32 of 48
TSC model – Decision variables
Decision variables: x,y,z
// cell configuration selector
dvar int x[configs] in 0..1
// row height/colum width selectors
dvar int y[rowHset] in 0..1
dvar int z[colWset] in 0..1
// glue
dvar int Gh[rows] in 0..maxint
dvar int Gw[columns] in 0..maxint

Building Table Formatting Tools

Slide 33 of 48
TSC model – Expressions
// cell width
dexpr int cellW[<i,j> in cells] =
sum(<i,j,k> in configs) x[<i,j,k>] * k.w;
// row height
dexpr int rowH[i in rows] =
sum(<i,h> in rowHset) y[<i,h>] * h;
// column width
dexpr int colW[j in cols] =
sum(<j,w> in colWset) z[<j,w>] * w;
// table height/width
dexpr int tableH = sum(i in rows) rowH[i];
dexpr int tableW = sum(j in cols) colW[j];

Building Table Formatting Tools

Slide 34 of 48
TSC Model - Constraints
minimize tableH;
constraints
{
ct1:
tableW <= pageW;
ct4: // select only one cell configuration
forall(i in rows,j in cols)
sum(<i,j,k> in configs) x[<i,j,k>] == 1;
ct4-1: // select only one row height
forall(i in rows)
sum(<i,k> in rowHset) y[<i,k>] == 1;
ct4-2: // select only one column width
forall(j in cols)
sum(<j,k> in colWset) z[<j,k>] == 1;

}

Building Table Formatting Tools

Slide 35 of 48
TSC Model - Constraints
constraints{
…
ct3: // select correct value for cell height
forall(i in rows,j in cols)
if (Sh[<i,j>] > 0)
cellH[<i,j>] <= sum(row in i..i+Sh[<i,j>])
(rowH[row] + Gh[row]);
else
cellH[<i,j>] <= rowH[i];
…
} //select only one cell configuration

Building Table Formatting Tools

Slide 36 of 48
TSC Model – Glue distribution
dexpr int glueW[<i,j,s> in colSpan] =
cellW[<i,j>] − sum(col in j..j+s) colW[col] ;
constraints{
…
 glueW is equally distributed
 to all s columns spanned by cell i, j.
forall(<i,j,s> in colSpan)
forall(col in j . . j+s )
Gw[col] <= glueW[<i,j,s>] / (s+1);
…
}

Building Table Formatting Tools

Slide 37 of 48
TSC Model - Experimental results

Running time for a 30x30 table
and up to 6 words per cell.

Building Table Formatting Tools

Slide 38 of 48
Building Table Formatting Tools

Slide 39 of 48
Sample output

Building Table Formatting Tools

Slide 40 of 48
Sample output – Nested tables

Building Table Formatting Tools

Slide 41 of 48
Sample output – Large Table

Building Table Formatting Tools

Slide 42 of 48
Conclusions
•

Building table tools is hard because tables can
contain any type of objects: text, images,
mathematical expressions and even other tables;

•

Operations at the table structure level are hard and
prone to errors. WYSIWYG tools are concerned
with presentation only;

•

Using a flexible presentation model such as the
hierarchical model with box elements raises a
number of problems which need to be addressed;

Building Table Formatting Tools

Slide 43 of 48
Conclusions
•

The TSC model is faster than our previous models:
we now report on larger tables 3600 cells (60x60);

•

Computing text configurations (the paragraphing
problem) is critical for this model

•

We can constrain “the glue” for tables with
spanning cells;

•

We have suggested a possible (simplified)
approach for solving the layout with nested tables;

Building Table Formatting Tools

Slide 44 of 48
Future work
To develop a model for tables with
• nested tables;
• other user constraints, i.e. constraints on group of
rows/columns;

Building Table Formatting Tools

Slide 45 of 48
Acknowledgements

We would like to express our gratitude to
Prof. David Parnas
for motivating much of this work

Building Table Formatting Tools

Slide 46 of 48
Acknowledgements

We would like to thank
Kim Marriott and Graeme Gange
for their valuable feedback

Building Table Formatting Tools

Slide 47 of 48
Building Table Formatting Tools

Questions ?

www.tabularlayout.org

Building Table Formatting Tools

Mais conteúdo relacionado

Semelhante a DocEng2011 Bilauca Healy - Building Table Formatting Tools

DLP_Observation-1.docx
DLP_Observation-1.docxDLP_Observation-1.docx
DLP_Observation-1.docxWyztyDelle2
 
AI-SDV 2022: Extracting information from tables in documents Holger Keibel (K...
AI-SDV 2022: Extracting information from tables in documents Holger Keibel (K...AI-SDV 2022: Extracting information from tables in documents Holger Keibel (K...
AI-SDV 2022: Extracting information from tables in documents Holger Keibel (K...Dr. Haxel Consult
 
Std 10 Computer Chapter 5 Introduction to Calc
Std 10 Computer Chapter 5 Introduction to CalcStd 10 Computer Chapter 5 Introduction to Calc
Std 10 Computer Chapter 5 Introduction to CalcNuzhat Memon
 
Contextless Object Recognition with Shape-enriched SIFT and Bags of Features
Contextless Object Recognition with Shape-enriched SIFT and Bags of FeaturesContextless Object Recognition with Shape-enriched SIFT and Bags of Features
Contextless Object Recognition with Shape-enriched SIFT and Bags of FeaturesUniversitat Politècnica de Catalunya
 
lec01.pdf
lec01.pdflec01.pdf
lec01.pdfBeiYu6
 
Data Structures - Lecture 1 - Unit 1.pptx
Data Structures  - Lecture 1 - Unit 1.pptxData Structures  - Lecture 1 - Unit 1.pptx
Data Structures - Lecture 1 - Unit 1.pptxDanielNesaKumarC
 
DocEng2013 Bilauca Healy - Splitting Wide Tables Optimally
DocEng2013 Bilauca Healy - Splitting Wide Tables OptimallyDocEng2013 Bilauca Healy - Splitting Wide Tables Optimally
DocEng2013 Bilauca Healy - Splitting Wide Tables Optimallymbilauca
 
Optimization Computing Platform for the Construction Industry
Optimization Computing Platform for the Construction IndustryOptimization Computing Platform for the Construction Industry
Optimization Computing Platform for the Construction IndustryKostas Dimitriou
 
Automatic Image Annotation (AIA)
Automatic Image Annotation (AIA)Automatic Image Annotation (AIA)
Automatic Image Annotation (AIA)Farzaneh Rezaei
 
6 data envelopment_analysis
6 data envelopment_analysis6 data envelopment_analysis
6 data envelopment_analysisFEG
 
Eng104 engineering drawing chp 0
Eng104   engineering drawing chp 0Eng104   engineering drawing chp 0
Eng104 engineering drawing chp 0Nur Aishah Azriy
 
Class[1][23ed may] [algorithms]
Class[1][23ed may] [algorithms]Class[1][23ed may] [algorithms]
Class[1][23ed may] [algorithms]Saajid Akram
 
Programming in python
Programming in pythonProgramming in python
Programming in pythonIvan Rojas
 
Data Analytics with R and SQL Server
Data Analytics with R and SQL ServerData Analytics with R and SQL Server
Data Analytics with R and SQL ServerStéphane Fréchette
 

Semelhante a DocEng2011 Bilauca Healy - Building Table Formatting Tools (20)

DLP_Observation-1.docx
DLP_Observation-1.docxDLP_Observation-1.docx
DLP_Observation-1.docx
 
AI-SDV 2022: Extracting information from tables in documents Holger Keibel (K...
AI-SDV 2022: Extracting information from tables in documents Holger Keibel (K...AI-SDV 2022: Extracting information from tables in documents Holger Keibel (K...
AI-SDV 2022: Extracting information from tables in documents Holger Keibel (K...
 
Std 10 Computer Chapter 5 Introduction to Calc
Std 10 Computer Chapter 5 Introduction to CalcStd 10 Computer Chapter 5 Introduction to Calc
Std 10 Computer Chapter 5 Introduction to Calc
 
Lecture 1 (bce-7)
Lecture   1 (bce-7)Lecture   1 (bce-7)
Lecture 1 (bce-7)
 
Overview of Computer Graphics
Overview of Computer GraphicsOverview of Computer Graphics
Overview of Computer Graphics
 
Editors l21 l24
Editors l21 l24Editors l21 l24
Editors l21 l24
 
Contextless Object Recognition with Shape-enriched SIFT and Bags of Features
Contextless Object Recognition with Shape-enriched SIFT and Bags of FeaturesContextless Object Recognition with Shape-enriched SIFT and Bags of Features
Contextless Object Recognition with Shape-enriched SIFT and Bags of Features
 
lec01.pdf
lec01.pdflec01.pdf
lec01.pdf
 
Data Structures - Lecture 1 - Unit 1.pptx
Data Structures  - Lecture 1 - Unit 1.pptxData Structures  - Lecture 1 - Unit 1.pptx
Data Structures - Lecture 1 - Unit 1.pptx
 
DocEng2013 Bilauca Healy - Splitting Wide Tables Optimally
DocEng2013 Bilauca Healy - Splitting Wide Tables OptimallyDocEng2013 Bilauca Healy - Splitting Wide Tables Optimally
DocEng2013 Bilauca Healy - Splitting Wide Tables Optimally
 
Optimization Computing Platform for the Construction Industry
Optimization Computing Platform for the Construction IndustryOptimization Computing Platform for the Construction Industry
Optimization Computing Platform for the Construction Industry
 
Automatic Image Annotation (AIA)
Automatic Image Annotation (AIA)Automatic Image Annotation (AIA)
Automatic Image Annotation (AIA)
 
Designmethodology1
Designmethodology1Designmethodology1
Designmethodology1
 
6 data envelopment_analysis
6 data envelopment_analysis6 data envelopment_analysis
6 data envelopment_analysis
 
Eng104 engineering drawing chp 0
Eng104   engineering drawing chp 0Eng104   engineering drawing chp 0
Eng104 engineering drawing chp 0
 
Class[1][23ed may] [algorithms]
Class[1][23ed may] [algorithms]Class[1][23ed may] [algorithms]
Class[1][23ed may] [algorithms]
 
Ch1
Ch1Ch1
Ch1
 
Programming in python
Programming in pythonProgramming in python
Programming in python
 
Data Analytics with R and SQL Server
Data Analytics with R and SQL ServerData Analytics with R and SQL Server
Data Analytics with R and SQL Server
 
Big datacourse
Big datacourseBig datacourse
Big datacourse
 

Último

The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESmohitsingh558521
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 

Último (20)

The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 

DocEng2011 Bilauca Healy - Building Table Formatting Tools

  • 1. DocEng2011, September 19– 22, 2011, Mountain View, California Building Table Formatting Tools Mihai Bilauca Patrick Healy Department of Computer Science and Information Systems University of Limerick, Ireland Supported by Science Foundation Ireland under the research programme 01/P1.2/C009, Mathematical Foundations, Practical Notations, and Tools for Reliable Flexible Software.
  • 2. Building Table Formatting Tools Why this paper? • Tables are widely used for presenting logical relationships between data items; • Widely spread WYSIWYG tools only control presentation parameters; • Existing tools have limitations; • Authoring tables is hard, time consuming and error prone; Building Table Formatting Tools Slide 2 of 48
  • 3. Building Table Formatting Tools Overview A) A review of logical table models; B) Table Drawing Tool Prototype: Typographical issues; C) Automated table layout optimization for tables with spanning cells:  Report experimental results for large tables  Comparison with previous models;  A simplified solution for nested tables; A) Conclusions Building Table Formatting Tools Slide 3 of 48
  • 4. Logical table models Building Table Formatting Tools Slide 4 of 48
  • 5. Logical table models 1985 Beach • An for Tioga DS that formats itself based on given dimensions • A “grid” with table topology and table geometry 1989 Cameron • Identifies 3 mental processes: structure, content & visual editing 1989 Vanoirbeek • a multidimensional collection of logically connected data items • each dimension is divided in rubrics to classify data items • merged items where an item is connected to multiple rubrics • defines tables in a language based on attribute grammars Building Table Formatting Tools Slide 5 of 48
  • 6. Logical table models 1996 Wang • layout structure (topology & typographic style) • logical structure: a mathematical model based on unordered sets • identified operations at table, category and label level 2010 Parnas • meaningful expressions which can be evaluated and validated • indexation separates table semantics from appearance • An indexed set of grids < GS, I, x > and each grid is an indexed set of expressions • A grid < SetExp, J, y > is a set of expressions SetExp, an indexed set J and a mapping y between SetExp and J Building Table Formatting Tools Slide 6 of 48
  • 7. Table Drawing Tool Prototype: Typographical issues; Building Table Formatting Tools Slide 7 of 48
  • 8. Table Drawing Tool - TDT • Part of a larger project developed at University of Limerick Ireland, a tabular expressions tool: – – – – Table Input Tool; Kernel; Evaluation module; Table Drawing Tool; • concerned only with drawing tables on a rendering device depending on the table layout using a layout optimizer; • current version supports rectangular tables which can be rendered in PDF using a layout optimizer based on IBM ILOG OPL; Building Table Formatting Tools Slide 8 of 48
  • 9. TDT Circular layout? Table 1 is represented with both rectangular and a circular layout Building Table Formatting Tools Slide 9 of 48
  • 10. TDT Device The device is an abstract object that must provide functions to: • open and close the device; • set colours, fill colours, line styles; • font settings (font family, style, size); • vertical and horizontal alignment; • text spacing (word, character and line spacing); • draw curves (bezier); • support for images; • support for paging the content; The device must return measurement units in the TDT coordinate system; Building Table Formatting Tools Slide 10 of 48
  • 11. TDT Hierarchical model A table layout tool needs to be as powerful as a page layout tool • TDT implements a hierarchical structure of containers (similar to the CSS) • It is each container’s responsibility to format itself • Each container must implement computeLayout and render on device functions • For drawing tables TDT implements a box model; Support for • Hierarchical propagation of typographical parameters • Layered control of typographical parameters Building Table Formatting Tools Slide 11 of 48
  • 12. TDT The Box model For drawing tables TDT implements a box model (similar to CSS) Building Table Formatting Tools Slide 12 of 48
  • 13. TDT Typographical issues • table layout: a caption and a layout (rectangular, circular, custom) • caption: label, number and caption text; Global numbering styles must be defined; example: Table A.12 Test data • laying containers: fixed and floating positioning. lay floating (nonfixed) containers on lines; complexity is increased with fixed position containers • lines: styles and joins: pattern, line cap, line join and miter limit; The pattern is defined as a dash array and a phase • margins: add or merge adjacent margins? Building Table Formatting Tools Slide 13 of 48
  • 14. TDT Typographical issues • coordinates space: TDT uses a coordinate system with points (1/72 inch) • text direction: right-to-left, top-to-bottom • equations: TDT uses WebEQ to render MathML expressions • images: conversion from pixels in the units of the coordinate system; • borders: without a clear definition of the lines styles, dealing with borders can be a major cause of frustration: – border space; – border alignment; – border priority; Building Table Formatting Tools Slide 14 of 48
  • 15. Border conflicts in Open Office Building Table Formatting Tools Slide 15 of 48
  • 16. Automated table layout optimization Building Table Formatting Tools Slide 16 of 48
  • 17. Building Table Formatting Tools Table layout optimization • For applications where finding the layout with the minimum height for a given width is important; • Because it is exact (not based on heuristics); • Priority should be given to user constraints imposed by space limitations or other aesthetic criteria; Building Table Formatting Tools Slide 17 of 48
  • 18. The Table Layout Problem Find a layout λ of a table ℑ with minimum such that height (λ ) width(λ ) < W W – a given page width Building Table Formatting Tools Slide 18 of 48
  • 19. Definitions (Anderson and Sobti) ℑ , m x n table, m rows, n columns, λ is a layout of ℑ k k Ci , j : {( wij , hij ) | 1 ≤ k ≤ K ij } is the set of configurations for cell i,j with 1 ≤ ki , j ≤ K ij the index of the configuration selected from Ci,j m height (λ ) = ∑ hi i =1 n width(λ ) = ∑ w j j =1 where hi = max(hi,j) for each row i, wj = max(wi,j) for each column j ki , j i, j hi , j = h Building Table Formatting Tools ki , j i, j wi , j = w Slide 19 of 48
  • 20. Cell configurations Example: k k Ci , j : {(hij , wij ) | 1 ≤ k ≤ K ij } Cell configurations for cell i,j this blue sky Building Table Formatting Tools this blue sky this blue sky Slide 20 of 48
  • 21. IP definition – simple tables m n minimize∑ max hi , j ,k ⋅ xi , j ,k i =1 j =1 subject to n 1) m ∑ max w i =1 j =1 2) where Building Table Formatting Tools ∑x i , j ,k i , j ,k ⋅ xi , j ,k ≤ W = 1, x ∈ {0,1} 1 ≤ ki , j ≤ K i , j Slide 21 of 48
  • 22. IP – Tables with spanning cells The height and width of a spanning cell i,j is 1) 2) S h i, j S w i, j hi , j = wi , j = i + S ih, j ∑h r r =i j + S iwj , ∑w c= j c the number of additional rows spanned by cell i,j the number of additional columns spanned by cell i,j Building Table Formatting Tools Slide 22 of 48
  • 23. Tables with spanning cells Two cases: A) cell 1,1 spans wide columns Building Table Formatting Tools B) cell 1,1 spans narrow columns Slide 23 of 48
  • 24. Tables with spanning cells A cell spanning narrow columns requires “glue” “Glue” is a concept similar to the “glue” introduced by Knuth - it stretches and shrinks as required; - its value can be further constraint; Building Table Formatting Tools Slide 24 of 48
  • 25. Tables with spanning cells For a spanning cell i,j the equations 1) and 2) become: 1) 2) g hi , j = wi , j = i + S ih, j ∑ (h r r =i j + S iwj , ∑ (w c= j c +g ) h r +g ) h r the vertical glue for row r w c w c the horizontal glue for column c g Building Table Formatting Tools Slide 25 of 48
  • 26. Tables with spanning cells a) hi , j = ∑ hi , j ,k ⋅ xi , j ,k m c) i =1 k b) wi , j = ∑ wi , j ,k ⋅ xi , j ,k n d) where x, y, z ∈ {0,1} Building Table Formatting Tools h ∈ Hi , r i wj = ∑ w ⋅ z j =1 k r i hi = ∑ h ⋅ y r i c j c j w ∈W j c j 1 ≤ k ≤ Ci , j , 1 ≤ c ≤ W j , 1 ≤ r ≤ Hi Slide 26 of 48
  • 27. IP definition – simple tables m minimize∑ hir ⋅ yir + g ih i =1 subject to n 1) wcj ⋅ z cj + g w ≤ W ∑ j 4)* j =1 2) 3) hi , j ≤ wi , j ≤ i + S ih, j (hr + g rh ) ∑ ( wc + g cw ) ∑ i , j ,k = 1, ∀i, j m 5) r =i j + S iwj , ∑x yir = 1 ∑ i =1 n 6) z cj = 1 ∑ j =1 c= j * dummy cells (0,0) are inserted for spanned cells Building Table Formatting Tools Slide 27 of 48
  • 28. Table Layout problem is NP-complete Demonstrated by: • 1996 Wang - demonstration using large integers; • 1999 Anderson and Sobti - using reductions of the clique problem to the table layout, on simple tables. Building Table Formatting Tools Slide 28 of 48
  • 29. OPL OPL – Optimization Programming Language designed for solving combinatorial optimization problems. • support for: – MIP and constraint programming including search specification; – logical and higher order constraints; – support for scheduling and resource allocation applications; • shares structure and syntax features with mathematical programming languages such as AMPL or GAMS • problems can be formulated in a language similar to their algebraic notation Building Table Formatting Tools Slide 29 of 48
  • 30. OPL Keywords dvar – decision variable. The purpose of an OPL model is to find values for the decision variables such that all constraints are satisfied dexpr - to express decision variables in a more compact way {dataType} - set of type dataType <x,y> - represents a tuple value; Building Table Formatting Tools Slide 30 of 48
  • 31. TSC Model - Data types tuple Conf {int w; int h;} tuple CellConf {int i; int j; Conf c;} int pageW; // page width {CellConf} configs; // set of cell configurations sample data: configs = {<0,0, <127,10>>, <0,0, <92,20>>, <0,1, <75,20>>,<0,2, <65,10>>,…,} {Cell} cells = {<i,j> | <i,j,k> in configs} {int} rows = {i | <i,j> in cells} {int} cols = {j | <i,j> in cells} Building Table Formatting Tools Slide 31 of 48
  • 32. TSC model - Additional data // for each column j, the set of possible widths {Pair} colWset = {<j, k.w> | <i,j,k> in configs: Sw[<i,j>==0}; // for each row i, the set of possible heights {Pair} rowHset = {<i, k.h> | <i,j,k> in configs: Sh[<i,j>==0}; Building Table Formatting Tools Slide 32 of 48
  • 33. TSC model – Decision variables Decision variables: x,y,z // cell configuration selector dvar int x[configs] in 0..1 // row height/colum width selectors dvar int y[rowHset] in 0..1 dvar int z[colWset] in 0..1 // glue dvar int Gh[rows] in 0..maxint dvar int Gw[columns] in 0..maxint Building Table Formatting Tools Slide 33 of 48
  • 34. TSC model – Expressions // cell width dexpr int cellW[<i,j> in cells] = sum(<i,j,k> in configs) x[<i,j,k>] * k.w; // row height dexpr int rowH[i in rows] = sum(<i,h> in rowHset) y[<i,h>] * h; // column width dexpr int colW[j in cols] = sum(<j,w> in colWset) z[<j,w>] * w; // table height/width dexpr int tableH = sum(i in rows) rowH[i]; dexpr int tableW = sum(j in cols) colW[j]; Building Table Formatting Tools Slide 34 of 48
  • 35. TSC Model - Constraints minimize tableH; constraints { ct1: tableW <= pageW; ct4: // select only one cell configuration forall(i in rows,j in cols) sum(<i,j,k> in configs) x[<i,j,k>] == 1; ct4-1: // select only one row height forall(i in rows) sum(<i,k> in rowHset) y[<i,k>] == 1; ct4-2: // select only one column width forall(j in cols) sum(<j,k> in colWset) z[<j,k>] == 1; } Building Table Formatting Tools Slide 35 of 48
  • 36. TSC Model - Constraints constraints{ … ct3: // select correct value for cell height forall(i in rows,j in cols) if (Sh[<i,j>] > 0) cellH[<i,j>] <= sum(row in i..i+Sh[<i,j>]) (rowH[row] + Gh[row]); else cellH[<i,j>] <= rowH[i]; … } //select only one cell configuration Building Table Formatting Tools Slide 36 of 48
  • 37. TSC Model – Glue distribution dexpr int glueW[<i,j,s> in colSpan] = cellW[<i,j>] − sum(col in j..j+s) colW[col] ; constraints{ … glueW is equally distributed to all s columns spanned by cell i, j. forall(<i,j,s> in colSpan) forall(col in j . . j+s ) Gw[col] <= glueW[<i,j,s>] / (s+1); … } Building Table Formatting Tools Slide 37 of 48
  • 38. TSC Model - Experimental results Running time for a 30x30 table and up to 6 words per cell. Building Table Formatting Tools Slide 38 of 48
  • 39. Building Table Formatting Tools Slide 39 of 48
  • 40. Sample output Building Table Formatting Tools Slide 40 of 48
  • 41. Sample output – Nested tables Building Table Formatting Tools Slide 41 of 48
  • 42. Sample output – Large Table Building Table Formatting Tools Slide 42 of 48
  • 43. Conclusions • Building table tools is hard because tables can contain any type of objects: text, images, mathematical expressions and even other tables; • Operations at the table structure level are hard and prone to errors. WYSIWYG tools are concerned with presentation only; • Using a flexible presentation model such as the hierarchical model with box elements raises a number of problems which need to be addressed; Building Table Formatting Tools Slide 43 of 48
  • 44. Conclusions • The TSC model is faster than our previous models: we now report on larger tables 3600 cells (60x60); • Computing text configurations (the paragraphing problem) is critical for this model • We can constrain “the glue” for tables with spanning cells; • We have suggested a possible (simplified) approach for solving the layout with nested tables; Building Table Formatting Tools Slide 44 of 48
  • 45. Future work To develop a model for tables with • nested tables; • other user constraints, i.e. constraints on group of rows/columns; Building Table Formatting Tools Slide 45 of 48
  • 46. Acknowledgements We would like to express our gratitude to Prof. David Parnas for motivating much of this work Building Table Formatting Tools Slide 46 of 48
  • 47. Acknowledgements We would like to thank Kim Marriott and Graeme Gange for their valuable feedback Building Table Formatting Tools Slide 47 of 48
  • 48. Building Table Formatting Tools Questions ? www.tabularlayout.org Building Table Formatting Tools