Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
BraillePlot
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Georg Graßnick
BraillePlot
Commits
6a3042e0
Commit
6a3042e0
authored
5 years ago
by
Leonard Kupper
Browse files
Options
Downloads
Patches
Plain Diff
Chnage diagram creation routine to use PointListContainer for ScatterPlot and LineChart.
parent
4cbd7d47
No related branches found
No related tags found
1 merge request
!39
App restructuring
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/de/tudresden/inf/mci/brailleplot/App.java
+8
-7
8 additions, 7 deletions
src/main/java/de/tudresden/inf/mci/brailleplot/App.java
with
8 additions
and
7 deletions
src/main/java/de/tudresden/inf/mci/brailleplot/App.java
+
8
−
7
View file @
6a3042e0
...
...
@@ -6,6 +6,7 @@ import de.tudresden.inf.mci.brailleplot.configparser.Printer;
import
de.tudresden.inf.mci.brailleplot.configparser.Representation
;
import
de.tudresden.inf.mci.brailleplot.csvparser.MalformedCsvException
;
import
de.tudresden.inf.mci.brailleplot.datacontainers.PointListContainer
;
import
de.tudresden.inf.mci.brailleplot.datacontainers.SimpleCategoricalPointListContainerImpl
;
import
de.tudresden.inf.mci.brailleplot.diagrams.CategoricalBarChart
;
import
de.tudresden.inf.mci.brailleplot.diagrams.Diagram
;
...
...
@@ -205,7 +206,6 @@ public final class App {
Reader
csvReader
=
new
BufferedReader
(
new
InputStreamReader
(
Objects
.
requireNonNull
(
csvStream
)));
CsvParser
csvParser
=
new
CsvParser
(
csvReader
,
','
,
'\"'
);
Diagram
diagram
;
CategoricalPointListContainer
<
PointList
>
container
;
CsvOrientation
csvOrientation
;
if
(
settingsReader
.
isTrue
(
SettingType
.
VERTICAL
).
orElse
(
false
))
{
csvOrientation
=
CsvOrientation
.
VERTICAL
;
...
...
@@ -214,18 +214,19 @@ public final class App {
}
switch
(
settingsReader
.
getSetting
(
SettingType
.
DIAGRAM_TYPE
).
orElse
(
""
))
{
case
"ScatterPlot"
:
c
ontainer
=
csvParser
.
parse
(
CsvType
.
DOTS
,
csvOrientation
);
PointListContainer
<
PointList
>
scatterPlotC
ontainer
=
csvParser
.
parse
(
CsvType
.
DOTS
,
csvOrientation
);
throw
new
UnsupportedOperationException
(
"Scatter Plots coming soon."
);
case
"LineChart"
:
c
ontainer
=
csvParser
.
parse
(
CsvType
.
DOTS
,
csvOrientation
);
PointListContainer
<
PointList
>
lineChartC
ontainer
=
csvParser
.
parse
(
CsvType
.
DOTS
,
csvOrientation
);
throw
new
UnsupportedOperationException
(
"Line Charts coming soon."
);
case
"BarChart"
:
try
{
// first try to parse as regualar bar chart and convert to single category bar cart.
container
=
new
SimpleCategoricalPointListContainerImpl
(
csvParser
.
parse
(
CsvType
.
X_ALIGNED
,
csvOrientation
));
CategoricalPointListContainer
<
PointList
>
barChartContainer
;
try
{
// first try to parse as regular bar chart and convert to single category bar cart.
barChartContainer
=
new
SimpleCategoricalPointListContainerImpl
(
csvParser
.
parse
(
CsvType
.
X_ALIGNED
,
csvOrientation
));
}
catch
(
MalformedCsvException
e
)
{
// else parse as categorical bar chart
c
ontainer
=
csvParser
.
parse
(
CsvType
.
X_ALIGNED_CATEGORIES
,
csvOrientation
);
barChartC
ontainer
=
csvParser
.
parse
(
CsvType
.
X_ALIGNED_CATEGORIES
,
csvOrientation
);
}
diagram
=
new
CategoricalBarChart
(
c
ontainer
);
diagram
=
new
CategoricalBarChart
(
barChartC
ontainer
);
break
;
default
:
throw
new
IllegalStateException
(
"Unknown diagram type: "
+
settingsReader
.
getSetting
(
SettingType
.
DIAGRAM_TYPE
).
orElse
(
"<none>"
));
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment