100% found this document useful (1 vote)
13 views45 pages

Data Visualization Toolkit Using JavaScript Rails and Postgres to Present Data and Geospatial Information Barrett Clark instant download

The document is a comprehensive guide on data visualization using JavaScript, Rails, and Postgres, authored by Barrett Clark. It covers various topics including ActiveRecord, D3.js, geospatial data, and SQL integration, providing practical examples and applications. The book aims to equip readers with the skills to effectively collect, transform, and visualize data for insightful analysis.

Uploaded by

kbhlkxx265
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
13 views45 pages

Data Visualization Toolkit Using JavaScript Rails and Postgres to Present Data and Geospatial Information Barrett Clark instant download

The document is a comprehensive guide on data visualization using JavaScript, Rails, and Postgres, authored by Barrett Clark. It covers various topics including ActiveRecord, D3.js, geospatial data, and SQL integration, providing practical examples and applications. The book aims to equip readers with the skills to effectively collect, transform, and visualize data for insightful analysis.

Uploaded by

kbhlkxx265
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 45

Data Visualization Toolkit Using JavaScript

Rails and Postgres to Present Data and


Geospatial Information Barrett Clark download

https://textbookfull.com/product/data-visualization-toolkit-
using-javascript-rails-and-postgres-to-present-data-and-
geospatial-information-barrett-clark/

Download full version ebook from https://textbookfull.com


We believe these products will be a great fit for you. Click
the link to download now, or visit textbookfull.com
to discover even more!

Source Code Analytics With Roslyn and JavaScript Data


Visualization Mukherjee

https://textbookfull.com/product/source-code-analytics-with-
roslyn-and-javascript-data-visualization-mukherjee/

Data Visualization with Python and JavaScript Scrape


Clean Explore Transform Your Data 1st Edition Kyran
Dale

https://textbookfull.com/product/data-visualization-with-python-
and-javascript-scrape-clean-explore-transform-your-data-1st-
edition-kyran-dale/

Earth Systems Data Processing and Visualization Using


MATLAB Zekâi ■en

https://textbookfull.com/product/earth-systems-data-processing-
and-visualization-using-matlab-zekai-sen/

Practical Data Science Cookbook Data pre processing


analysis and visualization using R and Python
Prabhanjan Tattar

https://textbookfull.com/product/practical-data-science-cookbook-
data-pre-processing-analysis-and-visualization-using-r-and-
python-prabhanjan-tattar/
Python Data Analysis: Perform data collection, data
processing, wrangling, visualization, and model
building using Python 3rd Edition Avinash Navlani

https://textbookfull.com/product/python-data-analysis-perform-
data-collection-data-processing-wrangling-visualization-and-
model-building-using-python-3rd-edition-avinash-navlani/

D3.js in Action: Data visualization with JavaScript 2nd


Edition Elijah Meeks

https://textbookfull.com/product/d3-js-in-action-data-
visualization-with-javascript-2nd-edition-elijah-meeks/

D3 js in Action Data visualization with JavaScript


Second Edition Elijah Meeks

https://textbookfull.com/product/d3-js-in-action-data-
visualization-with-javascript-second-edition-elijah-meeks/

Data Smart: Using Data Science to Transform Information


into Insight 2nd Edition Jordan Goldmeier

https://textbookfull.com/product/data-smart-using-data-science-
to-transform-information-into-insight-2nd-edition-jordan-
goldmeier/

Data Visualization Representing Information on Modern


Web 1st Edition Kirk

https://textbookfull.com/product/data-visualization-representing-
information-on-modern-web-1st-edition-kirk/
About This E-Book

EPUB is an open, industry-standard format for e-books. However, support for EPUB and its many
features varies across reading devices and applications. Use your device or app settings to customize the
presentation to your liking. Settings that you can customize often include font, font size, single or double
column, landscape or portrait mode, and figures that you can click or tap to enlarge. For additional
information about the settings and features on your reading device or app, visit the device manufacturer’s
Web site.
Many titles include programming code or configuration examples. To optimize the presentation of these
elements, view the e-book in single-column, landscape mode and adjust the font size to the smallest
setting. In addition to presenting code and configurations in the reflowable text format, we have included
images of the code that mimic the presentation found in the print book; therefore, where the reflowable
format may compromise the presentation of the code listing, you will see a “Click here to view code
image” link. Click the link to view the print-fidelity code image. To return to the previous page viewed,
click the Back button on your device or app.
Data Visualization Toolkit
Using JavaScript, Rails™, and Postgres to Present Data and
Geospatial Information Barrett Clark
Boston • Columbus • Indianapolis • New York • San Francisco • Amsterdam • Cape Town
Dubai • London • Madrid • Milan • Munich • Paris • Montreal • Toronto • Delhi • Mexico City
São Paulo • Sydney • Hong Kong • Seoul • Singapore • Taipei • Tokyo
Many of the designations used by manufacturers and sellers to distinguish their products are claimed as
trademarks. Where those designations appear in this book, and the publisher was aware of a trademark
claim, the designations have been printed with initial capital letters or in all capitals.
The author and publisher have taken care in the preparation of this book, but make no expressed or
implied warranty of any kind and assume no responsibility for errors or omissions. No liability is
assumed for incidental or consequential damages in connection with or arising out of the use of the
information or programs contained herein.
For information about buying this title in bulk quantities, or for special sales opportunities (which may
include electronic versions; custom cover designs; and content particular to your business, training goals,
marketing focus, or branding interests), please contact our corporate sales department at
[email protected] or (800) 382-3419.
For government sales inquiries, please contact [email protected].
For questions about sales outside the U.S., please contact [email protected].
Visit us on the Web: informit.com/aw
Library of Congress Control Number: 2016944665
Copyright © 2017 Pearson Education, Inc.
All rights reserved. Printed in the United States of America. This publication is protected by copyright,
and permission must be obtained from the publisher prior to any prohibited reproduction, storage in a
retrieval system, or transmission in any form or by any means, electronic, mechanical, photocopying,
recording, or likewise. For information regarding permissions, request forms and the appropriate contacts
within the Pearson Education Global Rights & Permissions Department, please visit
www.pearsoned.com/permissions/.
ISBN-13: 978-0-13-446443-5
ISBN-10: 0-13-446443-5
Text printed in the United States on recycled paper at RR Donnelley in Crawfordsville, Indiana.
1 16
To my children. Never stop exploring and asking questions
(even when you wear me out).
Contents

Foreword
Preface
Acknowledgments
About the Author
Part I ActiveRecord and D3
Chapter 1 D3 and Rails
Your Toolbox—A Three-Ring Circus
Database
Application Server
Graphing Library
Maryland Residential Sales App
Evaluating Data
Data Fields
Simple Pie Chart
Summary
Chapter 2 Transforming Data with ActiveRecord and D3
Pie Chart Revisited
Legible Labels
Mouseover Effects
You Can Function
Bar Chart
New Views, New Routes
Bar Chart Controller Actions
Bar Chart JavaScript
Scatter Plot
Scatter Plot?
Scatter Plot Controller Actions
Scatter Plot Views and Routes
Scatter Plot JavaScript
Scatter Plot Revisited
Box Plot
Quartiles
Boxes, Whiskers, Circles, What?!
Box Plot Data and Views
Box Plot JavaScript
Summary
Chapter 3 Working with Time Series Data
Historic Daily Weather Data
Weather Rails App
Weather Readings Model
Weather Readings Import
Weather Stations Model
Weather Stations Import
Simple Line Graph
Weather Controller
Fetch the Data
The View Files
Draw the Line Graph
Tweak 1: Simple Multiline Graph
Tweak 2: Add Circle to Highlight the Maximum Temperature
Tweak 3: Add Circle to Highlight the Minimum Temperature
Tweak 4: Add Text to Display the Temperature Change
Tweak 5: Add a Line Between the Focus Circles
Summary
Chapter 4 Working with Large Datasets
Git and Large Files
The Cloud
Hotlinking
Benchmarking
Benchmark and Compare
Benchmark All the Things
Querying “Big Data”
Using Scopes in the Model
Adding Indices
When Benchmarks and Statistics Lie
Summary
Part II Using SQL in Rails
Chapter 5 Window Functions, Subqueries, and Common Table Expression
Why Use SQL?
Database Portability Is a Lie
Tripping Over ActiveRecord
User-Defined Functions
Why?
Heresy!
How?
How to Use SQL in Rails
Scatter Plot with Mortgage Payment
Window Functions
Window Functions Greatest Hits
Lead and Lag
Partitions
First Value and Last Value
Row Number
Using Subqueries
Common Table Expression
CTE and the Heatmap
The Query
The Controller and View
The JavaScript
Summary
Chapter 6 The Chord Diagram
The Matrix Is the Truth
Flight Departures Data
Departures App
Airports
Carriers
Departures
Transforming the Data
Fetching the Data
Generating the Matrix
Finalizing the Matrix
Create the Views
Departures Controller and Routes
Departures View
Departures Style
Draw the Chord Diagram
Disjointed City Pairs
Using the Lead Window Function to Find Empty Leg Flights
Optimizing Slow Queries with the Materialized View
Draw the Disjointed City Pairs Chord Diagram
Summary
Chapter 7 Time Series Aggregates in Postgres
Finding Flight Segments
Creating a Series of Time
Turning Data into Time Series Data
Graphing the Timeline
Basic Timeline
Fancy Timeline
Summary
Chapter 8 Using a Separate Reporting Database
Transactional versus Reporting Databases
Worker Processes
Postgres Schemas
Working with Multiple Schemas in Rails
Defining the Schema Connection
Creating a New Schema
Creating Objects in the Reporting Schema
Materialized View in the Reporting Schema
Tables in the Reporting Schema
Summary
Part III Geospatial Rails
Chapter 9 Working with Geospatial Data in Rails
GIS Primer
It’s (Longitude, Latitude) Not (Latitude, Longitude)
Decimal Degrees
Degrees, Minutes, Seconds (DMS)
Datum
Map Projection
Spatial Reference System Identifier (SRID)
Three Feature Types
PostGIS
Postgres Contrib Modules
Installing PostGIS
PostGIS Functions
ActiveRecord and PostGIS
ActiveRecord PostGIS Adapter
Rails PostGIS Configuration
PostGIS Hosting Considerations
Using Geospatial Data in Rails
Creating Geospatial Table Fields
Latitude and Longitude
Simple GIS Calculation
Working with Shapefiles
Shapefile Import Schema
Importing from a Shapefile
Shapefile ETL
Update Missing lonlat Data
Summary
Chapter 10 Making Maps with Leaflet and Rails
Leaflet
Map Tiles
Map Layers
Incorporating Leaflet into Rails to Visualize Weather Stations
Using a Separate Rails Layout for the Map
Map Controller
Map Index
Map Data GeoJSON View
Mapping the Weather Stations
Visualizing Airports
Markers
Marker Cluster
Drawing Flight Paths
Visualizing Zip Codes
Updating the Maryland Residential Sales App for PostGIS
Zip Code Geographies
Importing the Zip Code Shapefile
Mapping Zip Codes
Choropleth
Summary
Chapter 11 Querying Geospatial Data
Finding Items within a Bounding Box
What Is a Bounding Box?
Writing a Bounding Box Query
Writing a Bounding Box Query Using SQL and PostGIS
Writing a Bounding Box Query Using ActiveRecord
Finding Items within the Bounding Box
Finding Items Near a Point
Writing the Query
Using ActiveRecord
Calculating Distance
Summary
Afterword
Appendix A Ruby and Rails Setup
Install Ruby
Create the App
More Gems
Config Files
Finalize the Setup
Appendix B Brief Postgres Overview
Installing Postgres
From Source
Package Manager
Postgres.app
SQL Tools
Command Line
GUI Tool
Bulk Importing Data
COPY SQL Statement
\copy PSQL Command
pg_restore
The Query Plan
Appendix C SQL Join Overview
Join Example Database Setup
Inner Join
Left Outer Join
Right Outer Join
Full Outer Join
Cross Join
Self Join
Index
Foreword

I pitched Addison-Wesley on the idea of a Professional Ruby Series way back in 2005. As research for
this foreword, I dug up the original proposal and looked at the list of titles that I envisioned would make
up the series in the future. Wow, what an exercise. Out of a dozen, only one of those original ideas became
reality, the fantastic Design Patterns in Ruby book by my old friend Russ Olsen. Literally none of the
others have seen the light of day, including Extending Rails into the Enterprise, Behavior Driven
Development in Ruby, Software Testing with Ruby, and AJAX on Rails.
Okay, I admit that some of those ideas kind of sucked. However, one of them definitely did not suck and
I’ve been holding out for it since the beginning: Processing and Displaying Data in Ruby. The reason is
that as series editor, a big part of my job is to make sure that we publish books that stand the test of time.
That’s no small feat given the accelerating pace of change in technology. But I absolutely know that the
need to collect, transform, and intelligently display data is an eternal problem in computing. I was
positive that if we published an awesome book covering that topic, it would fill a vital need in the
marketplace and sell many copies year after year.
That need was still apparent a few years later when I led a team wrangling terabytes of credit card
transaction records using Ruby domain-specific languages at Barclays Bank. It was there for many of my
clients at Hashrocket, and it was there in every one of my subsequent startups.
The fact is, our world is being systematically flooded by data. Never mind the normal domain datasets
for most of the apps we write, it’s event data and time-series logging that is really exploding. Not only
that, but the looming IoT (Internet of Things) revolution will dramatically increase the amount of
information we need to deal with, probably by orders of magnitude. Which means more and more of us
will be asked to participate in making sense of that data by transforming and visualizing it in a way that
makes sense for stakeholders.
In other words, I’ve been waiting over ten years for this book and can barely wait any longer! Luckily,
Barrett Clark has made that wait worthwhile. He’s got over ten years of experience with Ruby on Rails,
and the depth of his knowledge shines through in his writing, which I’m glad to report is clear, concise,
and confident. There are also three (count ‘em) sample applications from which to draw examples—I’m
sure that readers who are newer to programming will appreciate the abundance of working code as
starting points for their own projects.
This isn’t the biggest book in the series, but it covers a lot of ground. I was actually a little worried that
it might cover too much ground when I first saw the outline. But it works, and as I was able to make my
way through the manuscript I realized why. Barrett has been practicing all of this stuff in his day job for
many years—Postgres, D3, GIS, all of it! The knowledge in this book is not just pulled together from
reference material and blog posts, it’s real-world and hard-earned.
Best of all, this book flows. Like I did with my own contribution to the series, The Rails Way, Barrett
has made a noble effort to make the book readable from front to back. Each chapter builds on the previous
one, so that by the time you finish it you can go out and land a high-paying job as a Data Specialist! Well,
your mileage may vary, but you think I’m joking? Don’t tell anyone, but I got my first professional job as a
Java programmer back in 1996 after reading Java in 21 Days!
Let me know if you try it. And let’s see here, let me know if you know anyone that can write some of
these series books from my list, especially Domain Specific Languages in Ruby. That would be truly
epic!
Obie Fernandez
Brooklyn, NY
June 2016
Preface

I love data.
I have spent several years working with a lot of different types of data. Sometimes you control the data
collection, and sometimes you have to hunt down the data you need. Sometimes the data is clean and
orderly, and sometimes it requires a lot of work to clean it up.
What makes data interesting to me is that each project is different. They each ask something different of
you to bring their stories to life. As I worked through these visualizations I was reminded just how many
different skills and techniques come into play. Everything is aimed at a singular goal, though—to cut
through the clutter and let the data say what it has to say.
That is what this book is about—giving data a voice.

Audience
This book focuses on looking at data from the perspective of a web developer. More specifically, I’ll
speak from the perspective of a developer writing Ruby on Rails apps.
This book will make use of the following languages and tools: • Ruby on Rails (Rails 4.2.6)
• jQuery
• D3.js
• Leaflet.js
• PostgreSQL
• PostGIS
Do not worry if you are not too comfortable with something on that list or even anything on the list. I
will guide you through the process so that by the end of the book you feel comfortable with all of them.

Organization
I wrote with the intent of each chapter building on the previous chapter. You can see in “Structure and
Content” how the sections and chapters are broken up. My goal for readers who want to read the book
linearly from cover to cover is that by the end you feel like you have a solid foundation for working with
data, including geospatial data.
You could also approach this book from the perspective of wanting to see how to do something. In that
case you could look to the Index to find what you are looking for. You could also look at the
“Supplementary Materials” to see the commits for the three applications that are built through the course
of the book. Feel free to look through the source code and play with it
(https://github.com/DataVizToolkit/).

Structure and Content


The book is broken into three parts. In Part I, “ActiveRecord and D3,” we use ActiveRecord to retrieve
the data we need to implement several different types of charts. This part includes the following chapters:
• Chapter 1: D3 and Rails—This first chapter introduces you to the technology stack, takes you
through the thought process and steps involved in importing data, and shows you how to build a pie
chart using D3.
• Chapter 2: Transforming Data with ActiveRecord and D3—This chapter revisits the pie chart to
make it interactive, and then walks you through how to build a bar chart, scatter plot, and box plot.
• Chapter 3: Working with Time Series Data—This chapter looks at historic weather readings and
shows you how to build an interactive multi-line chart that displays the maximum and minimum
temperatures from a weather station for a year.
• Chapter 4: Working with Large Datasets—This chapter discusses working with large data files,
how to benchmark Ruby and SQL, and tweaks we can make to gain performance.
Part II, “Using SQL in Rails,” gets a little more SQL-centric. We will use window functions,
subqueries, and Common Table Expression to retrieve data: • Chapter 5: Window Functions, Subqueries,
and Common Table Expression—This chapter begins the discussion of how and when to use raw SQL in
your Rails app.
• Chapter 6: The Chord Diagram—In this chapter we create a new app for flight departures and
build a chord diagram to look at the origin-destination city-pairs for AA flights in 1999.
• Chapter 7: Time-Series Aggregates in Postgres—In this chapter we take the flight departure data
and convert it from transactional to time-series data to build a timeline diagram.
• Chapter 8: Using a Separate Reporting Database—This chapter discusses how to use a separate
database or database schema for a reporting database.
In Part III, “Geospatial Rails,” we will take a look at the geospatial aspects of the data with PostGIS.
We will draw maps with markers, import shapefiles, and query geo data.
• Chapter 9: Working with Geospatial Data in Rails—In this chapter you learn geospatial concepts
and begin looking at geographic data through the lens of geospatial SQL queries.
• Chapter 10: Making Maps with Leaflet and Rails—In this chapter we add maps to all three
applications using Leaflet.
• Chapter 11: Querying Geospatial Data—In this chapter we talk more about geospatial SQL
queries, and I discuss both the “Rails way” and the raw SQL way, to present both options to you so
you can choose the one that works best for you.
Appendixes include the following:
• Appendix A: Ruby and Rails Setup
• Appendix B: Brief Postgres Overview
• Appendix C: SQL Joins

Supplementary Materials
Throughout the course of this book we will build three Rails applications. The source code is available
so that you verify that you are following along correctly. The applications are broken up as follows:

Maryland Residential Sales


The first app is residential_sales. It looks at recent real estate data from the state of Maryland.
The repository is available on GitHub at https://github.com/DataVizToolkit/residential_sales.
Chapter 1: D3 and Rails
• Initial setup
• Import residential sales
• Draw the pie chart
Chapter 2: Transforming Data with ActiveRecord and D3
Another Random Scribd Document
with Unrelated Content
TIDINGS

L ISTEN, I who love thee well


Have travelled far, and secrets tell;
Cold the moon that gleams thine eyes,
Yet beneath her further skies
Rests for thee, a paradise.

I have plucked a flower in proof,


Frail, in earthly light forsooth:
See, invisible it lies
In this palm: now veil thine eyes:
Quaff its fragrancies.

Would indeed my throat had skill


To breathe thee music, faint and still—
Music learned in dreaming deep
In those lands, from Echo's lip ...
'Twould lull thy soul to sleep.
THE SON OF MELANCHOLY

U
U NTO blest Melancholy's house one happy day
I took my way:
Into a chamber was shown, whence could be seen
Her flowerless garden, dyed with sunlit green
Of myrtle, box, and bay.

Cool were its walls, shade-mottled, green and gold,


In heavy fold
Hung antique tapestries, from whose fruit and flower
Light had the bright hues stolen, hour by hour,
And time worn thin and old.

Silence, as of a virginal laid aside,


Did there abide.
But not for voice or music was I fain,
Only to see a long-loved face again—
For her sole company sighed.

And while I waited, giving memory praise,


My musing gaze
Lit on the one sole picture in the room,
Which hung, as if in hiding, in the gloom
From evening's stealing rays.

Framed in fast-fading gilt, a child gazed there,


Lovely and fair;
A face whose happiness was like sunlight spent
On some poor desolate soul in banishment,
Mutely his grief to share.

Long, long I stood in trance of that glad face,


Striving to trace
The semblance that, disquieting, it bore
To one whom memory could not restore,
Nor fix in time and space.

Sunk deep in brooding thus, a voice I heard


Whisper its word:
I turned—and, stooping in the threshold, stood
She—the dark mistress of my solitude,
Who smiled, nor stirred.

Her ghost gazed darkly from her pondering eyes


Charged with surmise;
Challenging mine, between mockery and fear,
She breathed her greeting, 'Thou, my only dear!
Wherefore such heavy sighs?'

'But this?' One instant lids her scrutiny veiled;


Her wan cheek paled.
'This child?' I asked. 'Its picture brings to mind
Remembrance faint and far, past thought to find,
And yet by time unstaled.'

Smiling, aloof, she turned her narrow head,


'Make thou my face thy glass,' she cried and said.
'What would'st thou see therein—thine own, or mine?
O foolish one, what wonder thou did'st pine?

Long thou hast loved me; yet hast absent been.


See now: Dark night hath pressed an entrance in.
Jealous! thou dear? Nay, come; by taper's beam
Share thou this pictured Joy with me, though nought but a dream.'
THE QUIET ENEMY

H EARKEN—NOW the hermit bee


Drones a quiet thren dy;
Greening on the stagnant pool
The criss-cross light slants silken-cool;
In the venomed yew tree wings
Preen and flit. The linnet sings.

Gradually the brave sun


Drops to a day's journey done;
In the marshy flats abide
Mists to muffle midnight-tide.
Puffed within the belfry tower
Hungry owls drowse out their hour....

Walk in beauty. Vaunt thy rose.


Flaunt thy transient loveliness.
Pace for pace with thee there goes
A shape that hath not come to bless.

I thine enemy?... Nay, nay.


I can only watch and wait
Patient treacherous time away,
Hold ajar the wicket gate.
THE FAMILIAR

'A RE you far away?'


'Yea, I am far—far;
Where the green wave shelves to the sand,
And the rainbows are;
And an ageless sun beats fierce
From an empty sky:
There, O thou Shadow forlorn,
Is the wraith of thee, I.'

'Are you happy, most Lone?'


'Happy, forsooth!
Who am eyes of the air; voice of the foam;
Ah, happy in truth.
My hair is astream, this cheek
Glistens like silver, and see,
As the gold to the dross, the ghost in the mirk,
I am calling to thee.'

'Nay, I am bound.
And your cry faints out in my mind.
Peace not on earth have I found,
Yet to earth am resigned.
Cease thy shrill mockery, Voice,
Nor answer again.'
'O Master, thick cloud shuts thee out
And cold tempests of rain.'
MAERCHEN

S OUNDLESS the moth-flit, crisp the death-watch tick;


Crazed in her shaken arbour bird did sing;
Slow wreathed the grease adown from soot-clogged wick:
The Cat looked long and softly at the King.

Mouse frisked and scampered, leapt, gnawed, squeaked;


Small at the window looped cowled bat a-wing;
The dim-lit rafters with the night-mist reeked:
The Cat looked long and softly at the King.

O wondrous robe enstarred, in night dyed deep:


O air scarce-stirred with the Court's far junketing:
O stagnant Royalty—A-swoon? Asleep?
The Cat looked long and softly at the King.
GOLD

S IGHED the wind to the wheat:—


'The Queen who is slumbering there,
Once bewildered the rose;
Scorned, "Thou un-fair!"
Once, from that bird-whirring court,
Ascended the ruinous stair.
Aloft, on that weed-hung turret, suns
Smote on her hair—
Of a gold by Archiac sought,
Of a gold sea-hid,
Of a gold that from core of quartz
No flame shall bid
Pour into light of the air
For God's Jews to see.'

Mocked the wheat to the wind—


'Kiss me! Kiss me!'
MIRAGE

... And burned the topless towers of Ilium

S TRANGE fabled face! From sterile shore to shore


O'er plunging seas, thick-sprent with glistening brine,
The voyagers of the World with sail and heavy oar
Have sought thy shrine.
Beauty inexorable hath lured them on:
Remote unnamèd stars enclustering gleam—
Burn in thy flowered locks, though creeping daybreak wan
Prove thee but dream.

Noonday to night the enigma of thine eyes


Frets with desire their travel-wearied brain,
Till in the vast of dark the ice-cold moon arise
And pour them peace again;
And with malign mirage uprears an isle
Of fountain and palm, and courts of jasmine and rose,
Whence far decoy of siren throats their souls beguile,
And maddening fragrance flows.

Lo, in the milken light, in tissue of gold


Thine apparition gathers in the air—
Nay, but the seas are deep, and the round world old,
And thou art named, Despair.
FLOTSAM

S CREAMED the far sea-mew. On the mirroring sands


Bell-shrill the oyster-catchers. Burned the sky.
Couching my cheeks upon my sun-scorched hands,
Down from bare rock I gazed. The sea swung by.

Dazzling dark blue and verdurous, quiet with snow,


Empty with loveliness, with music a-roar,
Her billowing summits heaving noon-aglow—
Crashed the Atlantic on the cliff-ringed shore,

Drowsed by the tumult of that moving deep,


Sense into outer silence fainted, fled;
And rising softly, from the fields of sleep,
Stole to my eyes a lover from the dead;

Crying an incantation—learned, Where? When?...


White swirled the foam, a fount, a blinding gleam
Of ice-cold breast, cruel eyes, wild mouth—and then
A still dirge echoing on from dream to dream.
MOURN'ST THOU NOW?

L ONG ago from radiant palace,


Dream-bemused, in flood of moon,
Stole the princess Seraphita
Into forest gloom.

Wail of hemlock; cold the dewdrops;


Danced the Dryads in the chace;
Heavy hung ambrosial fragrance;
Moonbeams blanched her ravished face.

Frail and clear the notes delusive;


Mocking phantoms in a rout
Thridded the night-cloistered thickets,
Wove their sorceries in and out....

Mourn'st thou now? Or do thine eyelids


Frame a vision dark, divine,
O'er this imp of star and wild-flower—
Of a god once thine?
THE GALLIASS

'T ELL me, tell me,


Unknown stranger,
When shall I sight me
That tall ship
On whose flower-wreathed counter is gilded, Sleep?'

'Landsman, landsman,
Lynx nor kestrel
Ne'er shall descry from
Ocean steep
That midnight-stealing, high-pooped galliass, Sleep.'

'Promise me, Stranger,


Though I mark not
When cold night-tide's
Shadows creep,
Thou wilt keep unwavering watch for Sleep.'

'Myriad the lights are,


Wayworn landsman,
Rocking the dark through
On the deep:
She alone burns none to prove her Sleep.'
THE DECOY

'T ELL us, O pilgrim, what strange She


Lures and decoys your wanderings on?
Cheek, eye, brow, lip, you scan each face,
Smile, ponder—and are gone.

'Are we not flesh and blood? Mark well,


We touch you with our hands. We speak
A tongue that may earth's secrets tell:
Why further will you seek?'

'Far have I come, and far must fare.


Noon and night and morning-prime,
I search the long road, bleak and bare,
That fades away in Time.

'On the world's brink its wild weeds shake,


And there my own dust, dark with dew,
Burns with a rose that, sleep or wake,
Beacons me—"Follow true!"'

'Her name, crazed soul? And her degree?


What peace, prize, profit in her breast?'
'A thousand cheating names hath she;
And none fore-tokens rest.'
SUNK LYONESSE

I N sea-cold Lyonesse,
When the Sabbath eve shafts down
On the roofs, walls, belfries
Of the foundered town,
The Nereids pluck their lyres
Where the green translucency beats,
And with motionless eyes at gaze
Make minstrelsy in the streets.

And the ocean water stirs


In salt-worn casemate and porch.
Plies the blunt-snouted fish
With fire in his skull for torch.
And the ringing wires resound;
And the unearthly lovely weep,
In lament of the music they make
In the sullen courts of sleep:

Whose marble flowers bloom for aye:


And—lapped by the moon-guiled tide—
Mock their carver with heart of stone,
Caged in his stone-ribbed side.
THE CATECHISM

'H AST thou then nought wiser to bring


Than worn-out songs of moon and rose?'
'Cracked my voice and broken my wing,
God knows.'

'Tell'st thou no truth of the life that is;


Seek'st thou from heaven no pitying sign?'
'Ask thine own heart these mysteries,
Not mine.'

'Where then the faith thou hast brought to seed?


Where the sure hope thy soul would feign?'
'Never ebbed sweetness—even out of a weed—
In vain.'

'Fool. The night comes.... 'Tis late. Arise:


Cold lap the waters of Jordan stream.'
'Deep be their flood and tranquil thine eyes
With a dream.'
FUTILITY

S INK, thou strange heart, unto thy rest.


Pine now no more, to pine in vain.
Doth not the moon on heaven's breast
Call the floods home again?

Doth not the summer faint at last?


Do not her restless rivers flow
When that her transient day is past
To hide them in ice and snow?

All this—thy world—an end shall make;


Planet to sun return again;
The universe, to sleep from wake,
In a last peace remain.

Alas, the futility of care


That, spinning thought to thought, doth weave
An idle argument on the air
We love not, nor believe.
BITTER WATERS

I
I N a dense wood, a drear wood,
Dark water is flowing;
Deep, deep, beyond sounding,
A flood ever flowing.

There harbours no wild bird,


No wanderer strays there;
Wreathed in mist, sheds pale Ishtar
Her sorrowful rays there.

Take thy net; cast thy line;


Manna sweet be thy baiting;
Time's desolate ages
Shall still find thee waiting

For quick fish to rise there,


Or butterfly wooing,
Or flower's honeyed beauty,
Or wood-pigeon cooing.

Inland wellsprings are sweet;


But to lips, parched and dry,
Salt, salt is the savour
Of these; faint their sigh.

Bitter Babylon's waters.


Zion, distant and fair.
We hanged up our harps
On the trees that are there.
WHO?

1ST STRANGER. WHO walks with us on the hills?

2ND STRANGER. I cannot see for the mist.

3RD STRANGER. Running water I hear,


Keeping lugubrious tryst
With its cresses and grasses and weeds,
In the white obscure light from the sky.

2ND STRANGER. Who walks with us on the hills?

WILD BIRD. Ay!... Aye!... Ay!...


A RIDDLE

T
T HE mild noon air of Spring again
Lapped shimmering in that sea-lulled lane.
Hazel was budding; wan as snow
The leafless blackthorn was a-blow.

A chaffinch clankt, a robin woke


An eerie stave in the leafless oak.
Green mocked at green; lichen and moss
The rain-worn slate did softly emboss.

From out her winter lair, at sigh


Of the warm South wind, a butterfly
Stepped, quaffed her honey; on painted fan
Her labyrinthine flight began.

Wondrously solemn, golden and fair,


The high sun's rays beat everywhere;
Yea, touched my cheek and mouth, as if,
Equal with stone, to me 'twould give
Its light and life.

O restless thought
Contented not. With 'Why' distraught.
Whom asked you then your riddle small?—
'If hither came no man at all

'Through this grey-green, sea-haunted lane,


Would it mere blackened nought remain?
Strives it this beauty and life to express
Only in human consciousness?'

Oh, rather, idly breaks he in


To an Eden innocent of sin;
And, prouder than to be afraid,
Forgets his Maker in the made.
THE OWL

W HAT if to edge of dream,


When the spirit is come,
Shriek the hunting owl,
And summon it home—
To the fear-stirred heart
And the ancient dread
Of man, when cold root or stone
Pillowed roofless head?

Clangs not at last the hour


When roof shelters not;
And the ears are deaf,
And all fears forgot:
Since the spirit too far has fared
For summoning scream
Of any strange fowl on earth
To shatter its dream?
THE LAST COACHLOAD

(To Colin)

C
C RASHED through the woods that lumbering Coach. The dust
Of flinted roads bepowdering felloe and hood.
Its gay paint cracked, its axles red with rust,
It lunged, lurched, toppled through a solitude

Of whispering boughs, and feathery, nid-nod grass.


Plodded the fetlocked horses. Glum and mum,
Its ancient Coachman recked not where he was,
Nor into what strange haunt his wheels were come.

Crumbling the leather of his dangling reins;


Worn to a cow's tuft his stumped, idle whip;
Sharp eyes of beast and bird in the trees' green lanes
Gleamed out like stars above a derelict ship.

'Old Father Time—Time—Time!' jeered twittering throat.


A squirrel capered on the leader's rump,
Slithered a weasel, peered a thieflike stoat,
In sandy warren beat on the coney's thump.

Mute as a mammet in his saddle sate


The hunched Postilion, clad in magpie trim;
Buzzed the bright flies around his hairless pate;
Yaffle and jay squawked mockery at him.

Yet marvellous peace and amity breathed there.


Tranquil the labyrinths of this sundown wood.
Musking its chaces, bloomed the brier-rose fair;
Spellbound as if in trance the pine-trees stood.

Through moss, and pebbled rut, the wheels rasped on;


That Ancient drowsing on his box. And still
The bracken track with glazing sunbeams shone;
Laboured the horses, straining at the hill....

But now—a verdurous height with eve-shade sweet;


Far, far to West the Delectable Mountains glowed.
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade

Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.

Let us accompany you on the journey of exploring knowledge and


personal growth!

textbookfull.com

You might also like