File size: 28,924 Bytes
d16b35e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1b5c1de
d16b35e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8092faa
d16b35e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8092faa
 
 
 
 
 
 
 
 
d16b35e
 
 
 
 
8092faa
d16b35e
 
 
 
 
8092faa
 
 
 
 
d16b35e
 
 
 
 
 
 
 
 
1b5c1de
d16b35e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>๐Ÿ”ฎ Mapping Nieman Lab's 2025 Journalism Predictions</title>
    <script src="libs/d3.min.js"></script>
    <script src="libs/plot.umd.min.js"></script>
    <style>
        body { 
            margin: 0; 
            font-family: Arial, sans-serif; 
        }
        #viz { 
            width: 100%; 
            height: 70vh; 
            position: relative;
            overflow: hidden;
        }
        #popup {
            display: none;
            position: absolute;
            background: white;
            border: 1px solid #ccc;
            padding: 15px;
            border-radius: 4px;
            box-shadow: 0 2px 10px rgba(0,0,0,0.1);
            max-width: 400px;
            z-index: 1000;
            font-size: 14px;
            line-height: 1.4;
            pointer-events: auto;
        }
        h1 {
        color: #1a1a1a;
            margin-bottom: 20px;
        }
        .intro {
            max-width: 800px;
            margin: 0 auto 40px;
            text-align: center;
            line-height: 1.6;
            color: #374151;
        }
        .popup-headline {
            font-weight: bold;
            margin-bottom: 8px;
        }
        .popup-author {
            color: #666;
            margin-bottom: 8px;
        }
        .popup-url {
            color: #0066cc;
            word-break: break-all;
        }
        #note {
            font-size: 14px;
            color: #555;
            text-align: center;
            margin-top: auto;  /* Pushes the note to the bottom */
            padding: 10px;
            background-color: #f8f8f8;
            border-top: 1px solid #ddd;
        }
    </style>
</head>
<body>
<div class="intro">
    <h1>๐Ÿ”ฎ Mapping Nieman Lab's 2025 Journalism Predictions</h1>
    <p>This interactive visualization maps <a href="https://www.niemanlab.org/collection/predictions-2025/" target="_blank">90 predictions from Nieman Lab contributors about the future of journalism in 2025</a>, clustered by theme using natural language processing. Each point represents a prediction - click to read the original article and details.<br/>
    <em>P.s.: Content from Nieman Lab is shared under a Creative Commons license.</em></p>
</div>
<div id="viz">
    <div id="popup"></div>
</div>

<div id="note">
    <p>Content from Nieman Lab is shared under a Creative Commons license. Code adapted from the <a href="https://github.com/huggingface/text-clustering" target="_blank">Text Clustering one by the HF team</a> and <a href="https://maartengr.github.io/BERTopic/index.html" target="_blank">Bertopic</a>.
    </p>
</div>
<script>
const pointsData = [{"x": 8.44501781463623, "y": -1.9416298866271973, "topic": 5, "headline": "The rise of informal news networks", "author": "Heather Chaplin", "url": "https://www.niemanlab.org/2024/12/the-rise-of-informal-news-networks/"}, {"x": 7.096116065979004, "y": -3.4139668941497803, "topic": 1, "headline": "The media industry adopts an insurgent strategy", "author": "Saba Long", "url": "https://www.niemanlab.org/2024/12/the-media-industry-adopts-an-insurgent-strategy/"}, {"x": 9.058985710144043, "y": 0.5641253590583801, "topic": 0, "headline": "New dimensions for news storytelling", "author": "Kawandeep Virdee", "url": "https://www.niemanlab.org/2024/12/new-dimensions-for-news-storytelling/"}, {"x": 9.15906810760498, "y": -0.604259729385376, "topic": 3, "headline": "Readers will seek out well-moderated spaces", "author": "Scott Lamb", "url": "https://www.niemanlab.org/2024/12/readers-will-seek-out-well-moderated-spaces/"}, {"x": 7.4088521003723145, "y": -2.1410419940948486, "topic": 6, "headline": "Breaking old habits", "author": "Andrea Faye Hart", "url": "https://www.niemanlab.org/2024/12/breaking-old-habits/"}, {"x": 6.837618827819824, "y": -2.639793872833252, "topic": 4, "headline": "The darkness that democracy dies in is here", "author": "Carrie Brown", "url": "https://www.niemanlab.org/2024/12/the-darkness-that-democracy-dies-in-is-here/"}, {"x": 8.178898811340332, "y": -4.384067058563232, "topic": 1, "headline": "There\u2019s no \u201cTrump Bump\u201d (and that\u2019s good!)", "author": "Hillary Frey", "url": "https://www.niemanlab.org/2024/12/theres-no-trump-bump-and-thats-good/"}, {"x": 9.176912307739258, "y": 1.1151294708251953, "topic": 0, "headline": "Journalists build the AI tools they actually want to use", "author": "Retha Hill", "url": "https://www.niemanlab.org/2024/12/journalists-build-the-ai-tools-they-actually-want-to-use/"}, {"x": 8.568703651428223, "y": -1.9133816957473755, "topic": 5, "headline": "We\u2019ll rethink scale, trust, and our life\u2019s work", "author": "S. Mitra Kalita", "url": "https://www.niemanlab.org/2024/12/well-rethink-scale-trust-and-our-lifes-work/"}, {"x": 9.80218505859375, "y": 1.529496669769287, "topic": 0, "headline": "Using AI to make news more accessible", "author": "Chitranshu Tewari", "url": "https://www.niemanlab.org/2024/12/using-ai-to-make-news-more-accessible/"}, {"x": 9.823975563049316, "y": 0.1786373257637024, "topic": 3, "headline": "Media companies will love their websites a lot less", "author": "Jonathan Hunt", "url": "https://www.niemanlab.org/2024/12/media-companies-will-love-their-websites-a-lot-less/"}, {"x": 7.814012050628662, "y": -3.551880121231079, "topic": 1, "headline": "An authoritarian anti-journalism playbook", "author": "Benjamin Toff", "url": "https://www.niemanlab.org/2024/12/an-authoritarian-anti-journalism-playbook/"}, {"x": 10.513821601867676, "y": -1.6853375434875488, "topic": -1, "headline": "We can\u2019t predict the future \u2014 but it\u2019s essential to plan for it", "author": "AX Mina", "url": "https://www.niemanlab.org/2024/12/we-cant-predict-the-future-but-its-essential-to-plan-for-it/"}, {"x": 9.129205703735352, "y": 1.2994041442871094, "topic": 0, "headline": "The year we stop talking about \u201cAI\u201d", "author": "Burt Herman", "url": "https://www.niemanlab.org/2024/12/the-year-we-stop-talking-about-ai/"}, {"x": 7.5631794929504395, "y": -3.7726199626922607, "topic": 1, "headline": "Journalism faces a reckoning, in Soviet style", "author": "Izabella Kaminska", "url": "https://www.niemanlab.org/2024/12/journalism-faces-a-reckoning-in-soviet-style/"}, {"x": 8.17159366607666, "y": -3.496154308319092, "topic": -1, "headline": "The federal attack on the press will trickle down locally", "author": "Katie Honan", "url": "https://www.niemanlab.org/2024/12/the-federal-attack-on-the-press-will-trickle-down-locally/"}, {"x": 6.893141269683838, "y": -3.2622017860412598, "topic": 4, "headline": "We\u2019ll reach beyond our own lane", "author": "Sharon Moshavi", "url": "https://www.niemanlab.org/2024/12/well-reach-beyond-our-own-lane/"}, {"x": 7.782461166381836, "y": -3.9657416343688965, "topic": 1, "headline": "Newsrooms will keep losing their conservative audiences", "author": "Jonathan Stray", "url": "https://www.niemanlab.org/2024/12/newsrooms-will-keep-losing-their-conservative-audiences/"}, {"x": 8.328720092773438, "y": -3.8211424350738525, "topic": 1, "headline": "The media becomes an activist for democracy", "author": "Gideon Lichfield", "url": "https://www.niemanlab.org/2024/12/the-media-becomes-an-activist-for-democracy/"}, {"x": 6.93303108215332, "y": -2.379122495651245, "topic": -1, "headline": "Embracing influencers as allies", "author": "Marlon A. Walker", "url": "https://www.niemanlab.org/2024/12/embracing-influencers-as-allies/"}, {"x": 8.412482261657715, "y": 0.28052857518196106, "topic": -1, "headline": "Action over analysis", "author": "Meredith Artley", "url": "https://www.niemanlab.org/2024/12/action-over-analysis/"}, {"x": 8.239283561706543, "y": -3.9283080101013184, "topic": 1, "headline": "The New York Times will hire a pro-Trump columnist", "author": "Matthew Pressman", "url": "https://www.niemanlab.org/2024/12/the-new-york-times-will-hire-a-pro-trump-columnist/"}, {"x": 7.821789741516113, "y": -3.1256449222564697, "topic": 1, "headline": "Watch your language", "author": "Doris Truong", "url": "https://www.niemanlab.org/2024/12/watch-your-language/"}, {"x": 9.876710891723633, "y": -0.062480129301548004, "topic": -1, "headline": "News websites hit an evolutionary dead end", "author": "Simon Allison", "url": "https://www.niemanlab.org/2024/12/news-websites-hit-an-evolutionary-dead-end/"}, {"x": 9.292717933654785, "y": -0.034649841487407684, "topic": -1, "headline": "Taking lessons from independent bookstores", "author": "Eric Nuzum", "url": "https://www.niemanlab.org/2024/12/taking-lessons-from-independent-bookstores/"}, {"x": 7.547028064727783, "y": -2.4716436862945557, "topic": 6, "headline": "No more baby steps in fixing crime coverage", "author": "Cassie Owens", "url": "https://www.niemanlab.org/2024/12/no-more-baby-steps-in-fixing-crime-coverage/"}, {"x": 7.68869161605835, "y": -2.934065818786621, "topic": -1, "headline": "Science journalism becomes plain old journalism", "author": "Siri Carpenter", "url": "https://www.niemanlab.org/2024/12/science-journalism-becomes-plain-old-journalism/"}, {"x": 7.461018085479736, "y": -1.6307631731033325, "topic": -1, "headline": "Accommodating journalists is in \u2014 or you\u2019re out", "author": "Rachel S. Hunt", "url": "https://www.niemanlab.org/2024/12/accommodating-journalists-is-in-or-youre-out/"}, {"x": 8.91421127319336, "y": 1.558112621307373, "topic": 0, "headline": "AI turns news into a conversation", "author": "Nikita Roy", "url": "https://www.niemanlab.org/2024/12/ai-turns-news-into-a-conversation/"}, {"x": 8.042552947998047, "y": -4.413753032684326, "topic": 1, "headline": "Covering Trump 2.0, now with less Trump", "author": "Joshua P. Darr", "url": "https://www.niemanlab.org/2024/12/covering-trump-2-0-now-with-less-trump/"}, {"x": 8.543889999389648, "y": -1.6245245933532715, "topic": 5, "headline": "The rebirth of local news", "author": "Sarabeth Berman", "url": "https://www.niemanlab.org/2024/12/the-rebirth-of-local-news/"}, {"x": 9.16274642944336, "y": -2.0761513710021973, "topic": 2, "headline": "To hell with algorithms", "author": "Rodney Gibbs", "url": "https://www.niemanlab.org/2024/12/to-hell-with-algorithms/"}, {"x": 9.39547348022461, "y": 0.783242404460907, "topic": 0, "headline": "Adjusting to a tech-heavy but code-light world", "author": "Daniel Trielli", "url": "https://www.niemanlab.org/2024/12/adjusting-to-a-tech-heavy-but-code-light-world/"}, {"x": 7.675912380218506, "y": -2.132913827896118, "topic": -1, "headline": "Journalism as a social service", "author": "Simon Galperin", "url": "https://www.niemanlab.org/2024/12/journalism-as-a-social-service/"}, {"x": 8.515488624572754, "y": -2.053623676300049, "topic": 5, "headline": "A renewed appetite for print", "author": "Aimee Rinehart", "url": "https://www.niemanlab.org/2024/12/a-renewed-appetite-for-print/"}, {"x": 9.204963684082031, "y": -0.4479573369026184, "topic": 3, "headline": "Bluesky is just the beginning", "author": "Ethan Toven-Lindsey", "url": "https://www.niemanlab.org/2024/12/bluesky-is-just-the-beginning/"}, {"x": 7.088955879211426, "y": -2.8292393684387207, "topic": 4, "headline": "Journalists fight digital decay", "author": "Basile Simon", "url": "https://www.niemanlab.org/2024/12/journalists-fight-digital-decay/"}, {"x": 7.850964069366455, "y": -2.691260576248169, "topic": -1, "headline": "A generation of journalists moves on", "author": "Meena Thiruvengadam", "url": "https://www.niemanlab.org/2024/12/a-generation-of-journalists-moves-on/"}, {"x": 10.357245445251465, "y": -1.5493714809417725, "topic": -1, "headline": "Prediction markets go mainstream", "author": "Taylor Lorenz", "url": "https://www.niemanlab.org/2024/12/prediction-markets-go-mainstream/"}, {"x": 7.835875511169434, "y": -3.224935293197632, "topic": -1, "headline": "Maybe we really are done with news?", "author": "Matt Carlson", "url": "https://www.niemanlab.org/2024/12/maybe-we-really-are-done-with-news/"}, {"x": 8.706042289733887, "y": 0.22054125368595123, "topic": 3, "headline": "A new generation of knowledge management tools", "author": "Jeremy Gilbert", "url": "https://www.niemanlab.org/2024/12/a-new-generation-of-knowledge-management-tools/"}, {"x": 10.028475761413574, "y": -0.9752873778343201, "topic": 2, "headline": "The podcast middle class will continue to shrink", "author": "Alex Sujong Laughlin", "url": "https://www.niemanlab.org/2024/12/the-podcast-middle-class-will-continue-to-shrink/"}, {"x": 9.02426815032959, "y": -2.260519027709961, "topic": 2, "headline": "Journalism has its Kendrick Lamar year", "author": "Delano Massey", "url": "https://www.niemanlab.org/2024/12/journalism-has-its-kendrick-lamar-year/"}, {"x": 7.88631534576416, "y": -3.726055860519409, "topic": 1, "headline": "Newsrooms fight back against criminalization", "author": "Jos\u00e9 Zamora", "url": "https://www.niemanlab.org/2024/12/newsrooms-fight-back-against-criminalization/"}, {"x": 6.960431098937988, "y": -2.824310302734375, "topic": 4, "headline": "Humanness > authenticity", "author": "Val\u00e9rie B\u00e9lair-Gagnon", "url": "https://www.niemanlab.org/2024/12/humanness-authenticity/"}, {"x": 8.349125862121582, "y": -2.720919609069824, "topic": -1, "headline": "Journalists embrace transparency about the business side", "author": "Jacob L. Nelson", "url": "https://www.niemanlab.org/2024/12/journalists-embrace-transparency-about-the-business-side/"}, {"x": 6.763571739196777, "y": -2.972921371459961, "topic": 4, "headline": "The line between activism and journalism breaks", "author": "Hafsa Maqsood", "url": "https://www.niemanlab.org/2024/12/the-line-between-activism-and-journalism-breaks/"}, {"x": 9.39100170135498, "y": 1.2959803342819214, "topic": 0, "headline": "Put AI at the beginning, not at the end", "author": "Ole Rei\u00dfmann", "url": "https://www.niemanlab.org/2024/12/put-ai-at-the-beginning-not-at-the-end/"}, {"x": 9.251703262329102, "y": 1.8666800260543823, "topic": 0, "headline": "The distinct human writer becomes more essential", "author": "Mario Garc\u00eda", "url": "https://www.niemanlab.org/2024/12/the-distinct-human-writer-becomes-more-essential/"}, {"x": 9.212112426757812, "y": -1.7202296257019043, "topic": 2, "headline": "Local collaboration follows contraction", "author": "Larry Ryckman", "url": "https://www.niemanlab.org/2024/12/local-collaboration-follows-contraction/"}, {"x": 9.474239349365234, "y": -2.0235114097595215, "topic": 2, "headline": "Public media embraces its future", "author": "Kerri Hoffman", "url": "https://www.niemanlab.org/2024/12/public-media-embraces-its-future/"}, {"x": 8.307257652282715, "y": -0.9246782064437866, "topic": -1, "headline": "Story budgets get reshaped to coax the disengaged", "author": "Jody Brannon", "url": "https://www.niemanlab.org/2024/12/story-budgets-get-reshaped-to-coax-the-disengaged/"}, {"x": 9.648368835449219, "y": 0.5126778483390808, "topic": -1, "headline": "B2B media shifts from content to solutions", "author": "Jay Lauf", "url": "https://www.niemanlab.org/2024/12/b2b-media-shifts-from-content-to-solutions/"}, {"x": 8.485305786132812, "y": -1.514387607574463, "topic": 5, "headline": "Lessons learned in The Building of Lost Causes", "author": "Linda Solomon Wood", "url": "https://www.niemanlab.org/2024/12/lessons-learned-in-the-building-of-lost-causes/"}, {"x": 8.514511108398438, "y": -3.458909273147583, "topic": -1, "headline": "Blocking out the audience\u2019s siren song", "author": "Jonas Kaiser", "url": "https://www.niemanlab.org/2024/12/blocking-out-the-audiences-siren-song/"}, {"x": 6.461420059204102, "y": -2.7899937629699707, "topic": 4, "headline": "Journalism education leads the change we seek", "author": "Mira Lowe", "url": "https://www.niemanlab.org/2024/12/journalism-education-leads-the-change-we-seek/"}, {"x": 8.235584259033203, "y": -0.37742146849632263, "topic": -1, "headline": "Newsrooms break new ground in AI", "author": "Chase Davis", "url": "https://www.niemanlab.org/2024/12/newsrooms-break-new-ground-in-ai/"}, {"x": 9.648283958435059, "y": -1.7892142534255981, "topic": 2, "headline": "Podcasting becomes the primary strategy, not an afterthought", "author": "Joni Deutsch", "url": "https://www.niemanlab.org/2024/12/podcasting-becomes-the-primary-strategy-not-an-afterthought/"}, {"x": 9.010839462280273, "y": 1.5115655660629272, "topic": 0, "headline": "Get ready for the AI-driven world of news", "author": "Gina Chua", "url": "https://www.niemanlab.org/2024/12/get-ready-for-the-ai-driven-world-of-news/"}, {"x": 9.827605247497559, "y": 1.4666876792907715, "topic": 0, "headline": "Antitrust and AI news converge and get local", "author": "Karina Montoya", "url": "https://www.niemanlab.org/2024/12/antitrust-and-ai-news-converge-and-get-local/"}, {"x": 9.649171829223633, "y": -1.464978814125061, "topic": 2, "headline": "Progressive media at a crossroads", "author": "Anthony Nadler", "url": "https://www.niemanlab.org/2024/12/progressive-media-at-a-crossroads/"}, {"x": 9.300054550170898, "y": -1.5130516290664673, "topic": 2, "headline": "Public media reconciles its past with the present", "author": "Kristen Muller", "url": "https://www.niemanlab.org/2024/12/public-media-reconciles-its-past-with-the-present/"}, {"x": 8.21888256072998, "y": -2.640571355819702, "topic": -1, "headline": "Conflict of interest norms will shift", "author": "Kaitlin C. Miller", "url": "https://www.niemanlab.org/2024/12/conflict-of-interest-norms-will-shift/"}, {"x": 7.195061683654785, "y": -2.105961322784424, "topic": 6, "headline": "The moral injury epidemic", "author": "Andrew Losowsky", "url": "https://www.niemanlab.org/2024/12/the-moral-injury-epidemic/"}, {"x": 9.610570907592773, "y": 1.669007420539856, "topic": 0, "headline": "Adaptive partnerships in the AI data marketplace", "author": "Courtney Radsch", "url": "https://www.niemanlab.org/2024/12/adaptive-partnerships-in-the-ai-data-marketplace/"}, {"x": 8.538067817687988, "y": -1.1496936082839966, "topic": -1, "headline": "Outlets pivot to promoting action, not just news", "author": "Anita Li", "url": "https://www.niemanlab.org/2024/12/outlets-pivot-to-promoting-action-not-just-news/"}, {"x": 9.442846298217773, "y": 1.1098229885101318, "topic": 0, "headline": "AI adoption matures in small and local newsrooms", "author": "Ernest Kung", "url": "https://www.niemanlab.org/2024/12/ai-adoption-matures-in-small-and-local-newsrooms/"}, {"x": 9.263209342956543, "y": -1.3434534072875977, "topic": 2, "headline": "Local media gets its swagger back", "author": "Fran Wills", "url": "https://www.niemanlab.org/2024/12/local-media-gets-its-swagger-back/"}, {"x": 7.562410831451416, "y": -3.8842029571533203, "topic": 1, "headline": "Focus on the people who elect populists", "author": "Francesco Zaffarano", "url": "https://www.niemanlab.org/2024/12/focus-on-the-people-who-elect-populists/"}, {"x": 6.556802749633789, "y": -2.8690528869628906, "topic": 4, "headline": "Young journalists will reimagine a better press", "author": "Christoph Mergerson", "url": "https://www.niemanlab.org/2024/12/young-journalists-will-reimagine-a-better-press/"}, {"x": 8.465250968933105, "y": -2.881842613220215, "topic": -1, "headline": "The publisher is always right", "author": "Gabe Schneider", "url": "https://www.niemanlab.org/2024/12/the-publisher-is-always-right/"}, {"x": 8.041629791259766, "y": -4.015467643737793, "topic": 1, "headline": "Journalists explain legislative procedure", "author": "Nik Usher", "url": "https://www.niemanlab.org/2024/12/journalists-explain-legislative-procedure/"}, {"x": 8.016718864440918, "y": -0.5251643657684326, "topic": -1, "headline": "Impact investment enters the chat", "author": "Adam Thomas", "url": "https://www.niemanlab.org/2024/12/impact-investment-enters-the-chat/"}, {"x": 9.30647087097168, "y": 1.7692039012908936, "topic": 0, "headline": "Divergent paths for journalism\u2019s future with AI", "author": "Alfred Hermida", "url": "https://www.niemanlab.org/2024/12/divergent-paths-for-journalisms-future-with-ai/"}, {"x": 7.298443794250488, "y": -3.590010166168213, "topic": 1, "headline": "Newsrooms reinvent their political journalism", "author": "Alexandra Borchardt", "url": "https://www.niemanlab.org/2024/12/newsrooms-reinvent-their-political-journalism/"}, {"x": 9.568115234375, "y": 1.326934576034546, "topic": 0, "headline": "AI companies grapple with what it means to be creators of news", "author": "Maggie Harrison Dupr\u00e9", "url": "https://www.niemanlab.org/2024/12/ai-companies-grapple-with-what-it-means-to-be-creators-of-news/"}, {"x": 8.867267608642578, "y": 0.02396288700401783, "topic": 3, "headline": "The year newsrooms tackle their structural issues", "author": "Nick Petrie", "url": "https://www.niemanlab.org/2024/12/the-year-newsrooms-tackle-their-structural-issues/"}, {"x": 8.832939147949219, "y": 1.0873624086380005, "topic": -1, "headline": "AI inspires innovation in journalism education", "author": "Cindy Royal", "url": "https://www.niemanlab.org/2024/12/ai-inspires-innovation-in-journalism-education/"}, {"x": 9.809760093688965, "y": -1.6418691873550415, "topic": 2, "headline": "Influencers become journalists", "author": "Jessica Maddox", "url": "https://www.niemanlab.org/2024/12/influencers-become-journalists/"}, {"x": 9.171928405761719, "y": -1.2261309623718262, "topic": 2, "headline": "The print revival comes to news", "author": "Esther Kezia Thorpe", "url": "https://www.niemanlab.org/2024/12/the-print-revival-comes-to-news/"}, {"x": 8.0382080078125, "y": -1.585949420928955, "topic": 5, "headline": "Communities relearn the habits of local news", "author": "Sam Mintz", "url": "https://www.niemanlab.org/2024/12/communities-relearn-the-habits-of-local-news/"}, {"x": 9.958175659179688, "y": -1.3390289545059204, "topic": 2, "headline": "Back to the bundle", "author": "Ben Smith", "url": "https://www.niemanlab.org/2024/12/back-to-the-bundle/"}, {"x": 8.175270080566406, "y": -4.323156356811523, "topic": 1, "headline": "Religious-sounding language will be everywhere in 2025", "author": "Whitney Phillips", "url": "https://www.niemanlab.org/2024/12/religious-sounding-language-will-be-everywhere-in-2025/"}, {"x": 8.503951072692871, "y": -0.14836566150188446, "topic": 3, "headline": "Newsroom planning goes silo-free", "author": "Kendall Trammell", "url": "https://www.niemanlab.org/2024/12/newsroom-planning-goes-silo-free/"}, {"x": 9.602263450622559, "y": 0.4812554717063904, "topic": 3, "headline": "You\u2019ll need to care more about your value chain", "author": "Sam Guzik", "url": "https://www.niemanlab.org/2024/12/youll-need-to-care-more-about-your-value-chain/"}, {"x": 8.86210823059082, "y": 1.6203187704086304, "topic": 0, "headline": "Play with AI like your career depends on it (it does)", "author": "Marie Gilot", "url": "https://www.niemanlab.org/2024/12/play-with-ai-like-your-career-depends-on-it-it-does/"}, {"x": 8.226726531982422, "y": -0.8211579322814941, "topic": -1, "headline": "Your Audience team is now your Creator team", "author": "Ryan Kellett", "url": "https://www.niemanlab.org/2024/12/your-audience-team-is-now-your-creator-team/"}, {"x": 9.464988708496094, "y": -1.6766172647476196, "topic": 2, "headline": "Sports journalists break away from access-based journalism", "author": "Brian Moritz", "url": "https://www.niemanlab.org/2024/12/sports-journalists-break-away-from-access-based-journalism/"}, {"x": 10.09488296508789, "y": -1.4310035705566406, "topic": 2, "headline": "The mainstream media will lose its last grip on relevancy", "author": "Alice Marwick", "url": "https://www.niemanlab.org/2024/12/the-mainstream-media-will-lose-its-last-grip-on-relevancy/"}, {"x": 9.498276710510254, "y": -0.7930121421813965, "topic": -1, "headline": "Meet the new metrics, same as the old metrics", "author": "Margarita Noriega", "url": "https://www.niemanlab.org/2024/12/meet-the-new-metrics-same-as-the-old-metrics/"}];
const labelData = [{"x": 9.316549301147461, "y": 1.365714192390442, "label": "AI, journalism, technology", "topic": 0}, {"x": 7.845077991485596, "y": -3.8511440753936768, "label": "Political news, journalist protections, legislative process", "topic": 1}, {"x": 9.518735885620117, "y": -1.605789065361023, "label": "Mainstream media, information overload, podcasting", "topic": 2}, {"x": 9.123933792114258, "y": -0.04231225699186325, "label": "Digital news design, audience-centered journalism, strategy", "topic": 3}, {"x": 6.794563293457031, "y": -2.8839304447174072, "label": " Journalism, democracy, change", "topic": 4}, {"x": 8.432768821716309, "y": -1.7722495794296265, "label": " Local, news, decline", "topic": 5}, {"x": 7.383647441864014, "y": -2.239548921585083, "label": " Crime, journalism, burnout", "topic": 6}];

function createVisualization() {
    const container = d3.select("#viz");

    // Set dynamic width and height for responsiveness
    const width = window.innerWidth;
    const height = window.innerHeight * 0.7;

    const plot = Plot.plot({
        width: width,
        height: height,
        margin: 50,
        style: {
            background: "white",
            fontSize: 12,
            overflow: "visible"
        },
        color: {
            scheme: "tableau10"
        },
        marks: [
            Plot.dot(pointsData, {
                x: "x",
                y: "y",
                fill: d => `topic${d.topic}`,
                r: 12,
                opacity: 0.6,
                stroke: "white",
                strokeWidth: 0.5
            }),
            Plot.text(labelData, {
                x: "x",
                y: "y",
                text: "label",
                fill: "black",
                fontSize: 16,
                fontWeight: "bold",
                dx: 0,
                dy: 0,
                background: true,
                backgroundPadding: 8,
                backgroundFill: "white",
                backgroundOpacity: 0.9
            })
        ],
        x: {
            axis: null
        },
        y: {
            axis: null
        }
    });

    container.node().appendChild(plot);
    
    const popup = d3.select("#popup");
    
    // Function to update popup content and position
    function updatePopup(circle) {
        const index = Array.from(document.querySelectorAll('circle')).indexOf(circle);
        const point = pointsData[index];
        const topic = point.topic;
        const topicLabel = labelData.find(l => l.topic === topic)?.label || 'Unknown Topic';
        
        popup
            .style("display", "block")
            .html(`
                <div class="popup-headline">${point.headline}</div>
                <div class="popup-author">By ${point.author || 'Unknown Author'}</div>
                <div class="popup-url">${point.url}</div>
                <div style="margin-top: 8px"><strong>Topic:</strong> ${topicLabel}</div>
            `);
        
        const rect = circle.getBoundingClientRect();
        const vizRect = document.getElementById("viz").getBoundingClientRect();
        const popupRect = popup.node().getBoundingClientRect();
        const windowWidth = window.innerWidth;
        const windowHeight = window.innerHeight;

        // Calculate initial position
        let leftPos = rect.left - vizRect.left + rect.width/2;
        let topPos = rect.top - vizRect.top - popupRect.height - 10;

        // Check if popup would go outside the window on the right
        if (rect.left + popupRect.width > windowWidth) {
            leftPos = windowWidth - popupRect.width - 20;
        }
        // Check if popup would go outside the window on the left
        if (leftPos < 0) {
            leftPos = 20;
        }

        // If popup would go above the window, place it below the point instead
        if (topPos < 0) {
            topPos = rect.top - vizRect.top + rect.height + 10;
        }

        popup
            .style("left", leftPos + "px")
            .style("top", topPos + "px");
    }

    // Handle clicks on points
    d3.selectAll("circle")
        .style("cursor", "pointer")
        .on("click", function(event) {
            event.stopPropagation();  // Prevent click from immediately closing popup
            updatePopup(this);
        });

    // Click anywhere else to close popup
    document.addEventListener("click", function() {
        popup.style("display", "none");
    });

    // Prevent popup from closing when clicking inside it
    popup.node().addEventListener("click", function(event) {
        event.stopPropagation();
    });
}

// Wait for everything to be loaded and on window resize to adjust
window.addEventListener('load', createVisualization);
window.addEventListener('resize', function() {
    // Re-create the visualization on window resize
    d3.select("#viz").html('');
    createVisualization();
});
</script>
</body>
</html>