Skip to content

Commit c6f3a4e

Browse files
committed
Rescaling images
1 parent 6afc838 commit c6f3a4e

6 files changed

+16
-9
lines changed

capstone.tex

+3-3
Original file line numberDiff line numberDiff line change
@@ -718,7 +718,7 @@ \section{Running It}\label{s:capstone-run}
718718
+ Built in 20.15s.
719719
\end{minted}
720720
721-
\figimg{figures/capstone-first-attempt.png}{First Attempt at Viewing Capstone Project}{f:capstone-first-attempt}
721+
\figimgscale{figures/capstone-first-attempt.png}{First Attempt at Viewing Capstone Project}{f:capstone-first-attempt}{0.5}
722722
723723
We then open \texttt{http://localhost:4000} in our browser and see \figref{f:capstone-first-attempt}.
724724
That's unexpected: we should see the initial data displayed.
@@ -783,15 +783,15 @@ \section{Running It}\label{s:capstone-run}
783783
\noindent
784784
and then re-launch our application to get \figref{f:capstone-second-attempt}.
785785
786-
\figimg{figures/capstone-second-attempt.png}{Second Attempt at Viewing Capstone Project}{f:capstone-second-attempt}
786+
\figimgscale{figures/capstone-second-attempt.png}{Second Attempt at Viewing Capstone Project}{f:capstone-second-attempt}{1.0}
787787
788788
This is much better.
789789
We can now type some dates into the ``start'' and ``end'' boxes and,
790790
after we press ``update'',
791791
we get a chart and table of the aggregated statistics for the year range given
792792
(\figref{f:capstone-complete}).
793793
794-
\figimg{figures/capstone-complete.png}{Completed Capstone Project}{f:capstone-complete}
794+
\figimgscale{figures/capstone-complete.png}{Completed Capstone Project}{f:capstone-complete}{1.0}
795795
796796
We've built an interface,
797797
used it to submit queries that are then handled by a server,

deploy.tex

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ \chapter{Deploying}\label{s:deploy}
5454
we'll be OK.
5555
\end{itemize}
5656

57-
\figimg{figures/glitch.png}{Glitch Deployment}{f:deploy-glitch}
57+
\figimgscale{figures/glitch.png}{Glitch Deployment}{f:deploy-glitch}{0.5}
5858

5959
Two things that \emph{aren't} automatically present are a license and a Code of Conduct,
6060
but both can easily be added by clicking on the ``New File'' button.

htmlcss.tex

+1-1
Original file line numberDiff line numberDiff line change
@@ -577,7 +577,7 @@ \section{Bootstrap}\label{s:htmlcss-bootstrap}
577577
</html>
578578
\end{minted}
579579
580-
\figimg{figures/htmlcss-bootstrap.png}{Bootstrap Layout}{f:htmlcss-bootstrap}
580+
\figimgscale{figures/htmlcss-bootstrap.png}{Bootstrap Layout}{f:htmlcss-bootstrap}{0.5}
581581
582582
The page opens by loading Bootstrap from the web;
583583
we can also download \texttt{bootstrap.min.css} and refer to it with a local path.

interactive.tex

+1-1
Original file line numberDiff line numberDiff line change
@@ -588,7 +588,7 @@ \section{Fetching Data}\label{s:interactive-fetching}
588588
\noindent
589589
and run it to get \figref{f:interactive-asteroids-screenshot}.
590590
591-
\figimg{figures/interactive-asteroids-screenshot.png}{Asteroids Application}{f:interactive-asteroids-screenshot}
591+
\figimgscale{figures/interactive-asteroids-screenshot.png}{Asteroids Application}{f:interactive-asteroids-screenshot}{0.5}
592592
593593
The next step is to handle date submission.
594594
Since we're trying to instill good practices,

pdf-settings.tex

+7
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,13 @@
129129
\caplbl{#2}{#3}%
130130
\end{figure}}
131131

132+
% Image figures with scale (for screenshots).
133+
\newcommand{\figimgscale}[4]{\begin{figure}%
134+
\centering%
135+
\includegraphics[scale=#4]{#1}%
136+
\caplbl{#2}{#3}%
137+
\end{figure}}
138+
132139
% PDF figures.
133140
\newcommand{\figpdf}[3]{\begin{figure}%
134141
\centering%

vis.tex

+3-3
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ \section{Vega-Lite}\label{s:vis-vega-lite}
139139
and feel very proud of ourselves
140140
(\figref{f:vis-mark-encoding}).
141141
142-
\figimg{figures/vis-mark-encoding.png}{Mark and Encoding}{f:vis-mark-encoding}
142+
\figimgscale{figures/vis-mark-encoding.png}{Mark and Encoding}{f:vis-mark-encoding}{0.5}
143143
144144
There are also some poorly-styled links for various controls that we're not going to use.
145145
We can fill in the options argument to \texttt{vegaEmbed} to turn those off:
@@ -166,7 +166,7 @@ \section{Vega-Lite}\label{s:vis-vega-lite}
166166
We now have the visualization we wanted
167167
(\figref{f:vis-disable-controls}).
168168
169-
\figimg{figures/vis-disable-controls.png}{Without Controls}{f:vis-disable-controls}
169+
\figimgscale{figures/vis-disable-controls.png}{Without Controls}{f:vis-disable-controls}{0.5}
170170
171171
Vega-Lite has a \emph{lot} of options:
172172
for example,
@@ -210,7 +210,7 @@ \section{Vega-Lite}\label{s:vis-vega-lite}
210210
211211
\figref{f:vis-aggregate-points} shows the result.
212212
213-
\figimg{figures/vis-aggregate-points.png}{Aggregating and Using Points}{f:vis-aggregate-points}
213+
\figimgscale{figures/vis-aggregate-points.png}{Aggregating and Using Points}{f:vis-aggregate-points}{0.5}
214214
215215
\section{Local Installation}\label{s:vis-vega-local}
216216

0 commit comments

Comments
 (0)